Skip to content
Open
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
d3f86dc
tests: introduce doctest infra + migrate llcommon/llmath/llcorehttp s…
mayconbekkers Oct 17, 2025
f0cc844
chore: drop unrelated .gitignore/.gitattributes changes
mayconbekkers Oct 20, 2025
788a7e4
style: satisfy pre-commit hooks
mayconbekkers Oct 20, 2025
4e3aeda
chore(license): add viewer OSS headers to doctest suites and note MIT…
mayconbekkers Oct 20, 2025
3548f4c
tests: share lltest harness and stabilize doctest targets on MSVC
mayconbekkers Dec 1, 2025
a7754f8
Merge branch 'develop' into feat/doctest-poc-clean
mayconbekkers Dec 1, 2025
793644a
tests(llmath): rewrap llbbox and llbboxlocal in doctest
mayconbekkers Mar 24, 2026
20f3f55
tests(llmath): rewrap alignment and llmodularmath in doctest
mayconbekkers Mar 24, 2026
ed76751
tests(llmath): rewrap m3math and xform in doctest
mayconbekkers Mar 24, 2026
777e13b
tests(llmath): rewrap v3color and v4coloru in doctest
mayconbekkers Mar 24, 2026
9005d58
tests(llmath): rewrap v4color and llrect in doctest
mayconbekkers Mar 24, 2026
2934c2d
tests(llmath): rewrap mathmisc and v3dmath in doctest
mayconbekkers Mar 24, 2026
d90f52a
tests(llmath): add explicit iostream include for alignment doctest
mayconbekkers Mar 24, 2026
4cbaa1c
test support: fill in a few missing TUT helpers for doctest
mayconbekkers Mar 27, 2026
b1716b5
llcharacter tests: move lljoint over to doctest
mayconbekkers Mar 27, 2026
d8d17c8
llfilesystem tests: move lldir and lldiriterator over to doctest
mayconbekkers Mar 27, 2026
dcc97c4
llimage tests: move llimageworker over to doctest
mayconbekkers Mar 27, 2026
10e04a6
llinventory tests: move inventorymisc and llparcel over to doctest
mayconbekkers Mar 27, 2026
a32b47a
llxml tests: move llcontrol over to doctest
mayconbekkers Mar 27, 2026
273634c
llui tests: move llurlmatch and llurlentry over to doctest
mayconbekkers Mar 27, 2026
756afce
llprimitive tests: move llprimitive over to doctest
mayconbekkers Mar 27, 2026
4359ec7
llprimitive tests: move llmediaentry over to doctest
mayconbekkers Mar 27, 2026
1e50ca3
llprimitive tests: move llgltfmaterial over to doctest
mayconbekkers Mar 28, 2026
a032467
llmessage tests: move llxfer_file over to doctest
mayconbekkers Mar 28, 2026
b202376
llmessage tests: move llavatarnamecache over to doctest
mayconbekkers Mar 28, 2026
1f41539
llmessage tests: move lltrustedmessageservice over to doctest
mayconbekkers Mar 28, 2026
e56b5ed
llmessage tests: move llpartdata over to doctest
mayconbekkers Mar 28, 2026
236acab
llmessage tests: move lltemplatemessagedispatcher over to doctest
mayconbekkers Mar 28, 2026
f38a680
llmessage tests: move llcoproceduremanager over to doctest
mayconbekkers Mar 28, 2026
00f1bdc
llmessage tests: move llhost over to doctest
mayconbekkers Mar 28, 2026
56f03dc
llmessage tests: move llnamevalue over to doctest
mayconbekkers Mar 28, 2026
da5d451
newview tests: move cppfeatures over to doctest
mayconbekkers Mar 28, 2026
8c01f51
newview tests: move llagentaccess over to doctest
mayconbekkers Mar 28, 2026
6aa26be
newview tests: move lldateutil over to doctest
mayconbekkers Mar 28, 2026
d1c6596
newview tests: move llversioninfo over to doctest
mayconbekkers Mar 28, 2026
38d0747
newview tests: move llworldmipmap over to doctest
mayconbekkers Mar 28, 2026
5d00199
newview tests: move llworldmap over to doctest
mayconbekkers Mar 28, 2026
0419099
newview tests: move llviewerhelputil over to doctest
mayconbekkers Mar 28, 2026
c982468
newview tests: move lllogininstance over to doctest
mayconbekkers Mar 28, 2026
fc159f4
newview tests: move llsecapi over to doctest
mayconbekkers Mar 28, 2026
60cb3d4
newview tests: move llslurl over to doctest
mayconbekkers Mar 28, 2026
53e5e3d
newview tests: move llviewernetwork over to doctest
mayconbekkers Mar 28, 2026
7604e34
newview tests: move llviewercontrollistener over to doctest
mayconbekkers Mar 28, 2026
a0cbcd6
newview tests: move llviewerassetstats over to doctest
mayconbekkers Mar 28, 2026
8f9524b
newview tests: move llsechandler_basic over to doctest
mayconbekkers Mar 28, 2026
7dbae78
llcommon tests: fix doctest include path
mayconbekkers Mar 28, 2026
708b9ed
test: stop building the legacy lltest driver
mayconbekkers Mar 28, 2026
4c6b31c
build: stop registering the dormant indra/test subdir
mayconbekkers Mar 28, 2026
b4dd99e
llxml: drop the old LL_ADD_* test hooks
mayconbekkers Mar 28, 2026
832e93b
llimage: drop the old LL_ADD_PROJECT_UNIT_TESTS hook
mayconbekkers Mar 28, 2026
a5140c4
llfilesystem: drop the old LL_ADD_* test hooks
mayconbekkers Mar 28, 2026
2f39dae
llinventory: drop the old LL_ADD_* test hooks
mayconbekkers Mar 28, 2026
b042b98
login tests: drop the old LL_ADD_PROJECT_UNIT_TESTS hook
mayconbekkers Mar 28, 2026
a4b7f8b
llprimitive: drop the old LL_ADD_PROJECT_UNIT_TESTS hook
mayconbekkers Mar 28, 2026
d2273a7
llui: drop the old LL_ADD_* test hooks
mayconbekkers Mar 28, 2026
c875e5e
llcorehttp: drop the old LL_ADD_INTEGRATION_TEST hook
mayconbekkers Mar 28, 2026
a8b2242
llmessage: drop the old LL_ADD_* test hooks
mayconbekkers Mar 28, 2026
fa1ec14
llmath: drop the old LL_ADD_* test hooks
mayconbekkers Mar 28, 2026
d7afdbd
newview: drop the old LL_ADD_* test hooks
mayconbekkers Mar 28, 2026
1122042
llcommon: drop the old tuple and workqueue hooks
mayconbekkers Mar 28, 2026
383db4f
cleanup: trim wrapper comments and eof noise
mayconbekkers Mar 28, 2026
3006e09
llui: include boost bind placeholders
mayconbekkers Mar 28, 2026
6b7f4f0
tests: trim placeholder text and review nits
mayconbekkers Mar 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .build-variables
Submodule .build-variables added at f8fad0
39 changes: 39 additions & 0 deletions docs/testing/doctest_quickstart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# doctest quickstart

Copilot AI Mar 24, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file appears to start with a UTF-8 BOM (the invisible character before #). BOMs can cause noisy diffs and occasional tooling quirks (some linters/Markdown processors treat it as text). Consider removing the BOM so the first character is #.

Suggested change
# doctest quickstart
# doctest quickstart

Copilot uses AI. Check for mistakes.

This repository uses a header-only doctest setup with a thin helpers/compat layer.

- Enable: `autobuild configure -c RelWithDebInfoOS -- -DLL_TESTS=ON`
- Build targets: `llcommon_doctest` (subset of llcommon tests), `llmath_doctest`, `llcorehttp_doctest`, `login_doctest`
- Run: `ctest -C RelWithDebInfo -R "(llcommon_doctest|llmath_doctest|llcorehttp_doctest|login_doctest)" -V`

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quickstart references login_doctest, but this PR's CMake changes only add doctest executables for llcommon/llmath/llcorehttp (plus a few other modules) and no login_doctest target is introduced in the provided diffs. Either add the missing target or remove/update login_doctest from the quickstart so instructions match what actually builds.

Copilot uses AI. Check for mistakes.

Notes:
- Hand-authored tests are marked with `// DOCTEST_SKIP_AUTOGEN` to keep the generator idempotent.
- `LL_CHECK_*` helpers provide clearer output for floats, buffers, wide strings, and ranges.
- The HTTP fakes layer keeps tests network/IO-free by simulating responses with a monotonic clock and per-handle queues (redirects, retries, cancels).

## Windows: local build with Autobuild and LL_TESTS

Assumes a Windows setup with Visual Studio and Autobuild available on PATH.

1. Open a “Developer Command Prompt for VS 2022” (x64).

2. Change to the viewer root, e.g.:

cd D:\Projects\viewer

3. Ensure there is a `build-variables` directory next to the source tree.
If you already have `.build-variables` in this checkout, clone it locally:
xcopy /E /I .build-variables build-variables

4. Configure a RelWithDebInfo build with tests enabled:
autobuild configure -c RelWithDebInfoOS -- -DLL_TESTS=ON

5. Build the viewer and test binaries:
autobuild build -c RelWithDebInfoOS

6. Run the doctest-based targets via CTest (adjust the build directory name if needed):
ctest -C RelWithDebInfo ^
-R "(llcommon_doctest|llmath_doctest|llcorehttp_doctest|login_doctest)" ^
-V --test-dir build-vc170-64

The Autobuild configuration name (`RelWithDebInfoOS`) maps to the Visual Studio configuration `RelWithDebInfo`, which is the value used with `ctest -C`.
8 changes: 2 additions & 6 deletions indra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ project(${ROOT_PROJECT_NAME})

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_BINARY_DIR}")

enable_testing()

Copilot AI Mar 24, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description says changes only affect unit-test targets behind LL_TESTS=ON, but enable_testing() is now unconditional at the indra root. If the intent is to keep non-test builds unchanged, gate this behind if(LL_TESTS) (or equivalent) and rely on per-module enable_testing()/add_test() only when tests are enabled.

Copilot uses AI. Check for mistakes.

include(conanbuildinfo OPTIONAL RESULT_VARIABLE USE_CONAN )
if( USE_CONAN )
set( USE_CONAN ON )
Expand Down Expand Up @@ -92,11 +94,6 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llplugin)
add_subdirectory(${LIBS_OPEN_PREFIX}llui)
add_subdirectory(${LIBS_OPEN_PREFIX}viewer_components)

if( LL_TESTS )
# Legacy C++ tests. Build always, run if LL_TESTS is true.
add_subdirectory(${VIEWER_PREFIX}test)
endif()

if (ENABLE_MEDIA_PLUGINS)
# viewer media plugins
add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins)
Expand Down Expand Up @@ -147,4 +144,3 @@ if (LL_TESTS)
# individual apps can add themselves as dependencies
add_subdirectory(${INTEGRATION_TESTS_PREFIX}integration_tests)
endif (LL_TESTS)

1 change: 1 addition & 0 deletions indra/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ set(cmake_SOURCE_FILES
DeploySharedLibs.cmake
Discord.cmake
DragDrop.cmake
Doctest.cmake
EXPAT.cmake
FindAutobuild.cmake
FreeType.cmake
Expand Down
6 changes: 6 additions & 0 deletions indra/cmake/Doctest.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- cmake -*-
include_guard(GLOBAL)

if(NOT DEFINED DOCTEST_INCLUDE_DIR)
set(DOCTEST_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/extern/doctest")
endif()
2 changes: 2 additions & 0 deletions indra/cmake/LLAddBuildTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources)
set(alltest_SOURCE_FILES
${CMAKE_SOURCE_DIR}/test/test.cpp
${CMAKE_SOURCE_DIR}/test/lltut.cpp
${CMAKE_SOURCE_DIR}/test/lltest_harness.cpp
)
set(alltest_DEP_TARGETS
# needed by the test harness itself
Expand Down Expand Up @@ -200,6 +201,7 @@ FUNCTION(LL_ADD_INTEGRATION_TEST
tests/${testname}_test.cpp
${CMAKE_SOURCE_DIR}/test/test.cpp
${CMAKE_SOURCE_DIR}/test/lltut.cpp
${CMAKE_SOURCE_DIR}/test/lltest_harness.cpp
${additional_source_files}
)

Expand Down
21 changes: 21 additions & 0 deletions indra/extern/doctest/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2016-2024 Viktor Kirilov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading