Skip to content

Conversation

@mayconbekkers
Copy link

Relates to #4445.

This PR adds a header-only doctest setup and migrates a first wave of unit tests while keeping the legacy TUT harness for suites not yet ported. The goal is to land a minimal, working baseline that the team can iterate on module by module.
This affects only unit-test targets behind LL_TESTS=ON; viewer runtime and packages are unchanged.

What’s included

  • New doctest targets: llcommon_doctest, llmath_doctest, llcorehttp_doctest
  • Shared helpers (LL_CHECK_* for floats, ranges, buffers, wide strings) + small Windows wide-string shim
  • Deterministic llcorehttp fakes (zero-latency transport, monotonic clock, queued per-handle responses, redirects/retries/cancels) to keep tests network/IO-free
  • Suites green locally:
    • llcommon_doctest: 100 cases
    • llmath_doctest: 93 cases
    • llcorehttp_doctest: 34 cases
  • Quickstart doc: docs/testing/doctest_quickstart.md

How to run locally

# Enable tests
autobuild configure -c RelWithDebInfoOS -- -DLL_TESTS=ON

# Build (VS generator)
"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" --build build-vc170-64 --config RelWithDebInfo --target llcommon_doctest llmath_doctest llcorehttp_doctest -- /p:BuildProjectReferences=false

# Run
"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\ctest.exe" -C RelWithDebInfo -R "(llcommon_doctest|llmath_doctest|llcorehttp_doctest)" -V --test-dir build-vc170-64

Scope / non-goals

Does not change viewer runtime or packaging.
TUT remains for non-migrated suites; removal will happen after follow-ups when coverage is sufficient.

Proposed follow-ups

Continue migrating remaining suites per module (llcommon -> llmath -> llcorehttp -> newview/test).
Once coverage is high enough, remove Tut.cmake glue and clean up LLAddBuildTest.cmake usage.

@github-actions
Copy link

github-actions bot commented Oct 17, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@mayconbekkers
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@Ansariel
Copy link
Contributor

What are the changes to .gitignore and .gitattributes for? They seem in no relation to doctest and counterproductive,

@mayconbekkers mayconbekkers force-pushed the feat/doctest-poc-clean branch 2 times, most recently from 2acfa79 to 5fb6af0 Compare October 20, 2025 23:28
@mayconbekkers mayconbekkers force-pushed the feat/doctest-poc-clean branch from 5fb6af0 to dddc098 Compare October 20, 2025 23:34
@mayconbekkers
Copy link
Author

@Ansariel Thanks for the note! I’ve dropped the unrelated .gitignore/.gitattributes edits so this PR stays focused on doctest.
Also added the standard $LicenseInfo headers to the new test files and a third-party MIT notice for indra/extern/doctest/doctest.h.
pre-commit run -a passes locally; once workflows are approved for this fork, CI should reflect that.
Happy to adjust anything else if the maintainers prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants