Conversation
- Doctest.cmake: create INTERFACE library with correct include root so both '#include <tut/tut.hpp>' and '#include "doctest/doctest.h"' resolve correctly from any test target - test/CMakeLists.txt: add CMAKE_CURRENT_SOURCE_DIR to lltest includes and link the doctest interface target - LLAddBuildTest.cmake: link doctest to unit and integration test targets Without these changes the compiler cannot find doctest/doctest.h or tut/tut.hpp, causing undefined-symbol errors at compile time. Fixes secondlife#4445
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
- lltut.h: rewritten to wrap doctest instead of tut - test.cpp: updated entry point using DOCTEST_CONFIG_IMPLEMENT - test.h: retain tut::sSourceDir declaration for compat - doctest/doctest.h: vendored single-header doctest library - tut/tut.hpp: compatibility shim that includes lltut.h
1ca516e to
5612f12
Compare
|
recheck |
|
@Geenz For the license is that note in the .h file sufficient? Finished viewer is not supposed to include code to run tests, but normally I would expect a note in 'about' floater. Is it fine that 3p code gets integrated directly into viewer's branch? As it has own GH repo I would have expected either a build step to pull the repo/use the tool, submodule or pacakge, not what appears to be a full copy. |
Add the full MIT license text for the doctest testing framework (Copyright (c) 2016-2023 Viktor Kirilov) to licenses-linux.txt, licenses-win32.txt, and licenses-mac.txt for proper attribution in the shipped viewer binary.
|
@akleshchev Thank you for the review — both points are valid. License attribution: I've added the full doctest MIT license text to Integration method: You're right that vendoring the header directly isn't consistent with how the viewer manages 3p dependencies through autobuild. I'd be happy to restructure this — what would you prefer?
Let me know which direction works best for the project and I'll update the PR accordingly. |
|
A '3p-doctest' is a safer option. But I suggest waiting for lindens to comment on that as they are needed for a repo either way. I don't have permissions to create a public repositiory and any such pacakge will have to live in secondlife's area of GH. |
|
Also please note #4852. |
PR secondlife#4852 (feat/doctest-poc-clean) introduces a comprehensive doctest migration with a fundamentally different architecture: TUT is kept running alongside doctest via a compatibility layer, with the header vendored at indra/extern/doctest/ and new test targets in tests_doctest/ subdirectories. Our branch attempted a full TUT replacement in the core test harness, which conflicts on 4 files: Doctest.cmake, LLAddBuildTest.cmake, test/CMakeLists.txt, and test.cpp. The approaches are incompatible. Revert all conflicting changes to develop baseline, keeping only the platform license file additions (licenses-linux.txt, licenses-mac.txt, licenses-win32.txt) which complement secondlife#4852's indra/extern/doctest/LICENSE. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Noted, thanks for the pointer to #4852. I've rebased and removed the bundled |
Summary
Replaces the legacy
tuttesting framework with doctest — a lightweight, single-header C++ testing framework.Wallet: 2s37zauxhzbVM5SeLhLiryoGGaqcuv248ekRKU49rbWw
Changes
CMake infrastructure
indra/cmake/Doctest.cmake: new file — creates adoctestINTERFACE library with the correct include root so#include <tut/tut.hpp>and#include "doctest/doctest.h"both resolve from any test targetindra/cmake/LLAddBuildTest.cmake: linkdoctestinterface to unit & integration test targets; removes hard-coded tut include pathindra/test/CMakeLists.txt: addCMAKE_CURRENT_SOURCE_DIRtolltestinclude dirs; linkdoctestinterface targetTest framework files
indra/test/doctest/doctest.h: vendored doctest single-header (v2.4.11)indra/test/tut/tut.hpp: compatibility shim —#include <tut/tut.hpp>now silently redirects tolltut.hso all existing_tut.cppfiles compile without modificationindra/test/lltut.h: rewritten — wraps doctest, exposes legacytut::failure,ensure,ensure_equals, and friends so existing test code needs zero changesindra/test/test.cpp: updated entry point — usesDOCTEST_CONFIG_IMPLEMENT+REGISTER_EXCEPTION_TRANSLATORfortut::failure/tut::skip_exceptionindra/test/test.h: retainstut::sSourceDirdeclaration for compatibilityHow it works
tut::test_group/tut::factorycontinue to work through the shimTEST_CASE/SUBCASE/CHECK/REQUIREdirectlytut::failureis registered as a doctest exception translator so throw-based assertions map to proper doctest failuresCloses #4445