Repository navigation
Test framework, stage 5: TUT removed - #479
Conversation
The last TUT test: llimagej2ckdu_test, the codec compiled into its test over stubs of llimage and of the KDU calls it makes, becomes a binary of its own (al_add_test_binary with UNIT), linking what the TUT test linked. Its three tests are cases with checks, named for what they check, and hold the images they pass as locals where the TUT tests leaked them. It is built only with AL_USE_KDU, and KDU has no vcpkg port yet, so this has not been compiled: the conversion is by hand and unchecked until a build with KDU exists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fixtures production code befriends by name -- alincludesearch_data and the two llfontregistry data structs -- move to ll_test with their friend declarations, beside the probes already there. The other test files the conversion left in namespace tut (llcommon's date, error, event dispatcher, LEAP, process, LLSD and Python serialisation tests, and llmessage's io test) put it in an anonymous namespace, as everything local to a test file is: tut::call_exc and tut::call_logerr are ::call_exc and ::call_logerr, which members of those names still reach past, and tut::TestRecorder is TestRecorder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every test is Catch2 now (TM26): - externals/tut, ll::tut, the TUT runner (lltut.h, lltut.cpp, test.cpp, chained_callback.h, lltut_runner_lib) and setenv.h, which nothing included, are deleted. - al_add_test and LLAddBuildTest.cmake are deleted. The library path a test runs with, AL_TEST_ENVIRONMENT, is defined in ALAddTestBinary.cmake now. - The helpers TUT tests shared and Catch2 tests still use -- sync.h, namedtempfile.h and the rest -- are listed with the harness. - AL_TEST_CATCH2 goes, and the TUT branches it chose between: sync.h fails a timeout with FAIL, and the headless UI and the shared GL context have the one body each, so no object library built without the define can give one of them a second static. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The comments that told of TUT as the tests' framework -- headers to include before lltut.h, test.cpp as the main, fixtures made per test method, test functions run in sequence, a TUT banner over each file's tests -- say what Catch2 does. Those that say why a helper does as TUT did are left. CI's LOGFAIL is the tests' main's, and llprocess's comment names llleap's test rather than its old target. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
doc/TESTING.md says how to run the tests, a file, a case, in another order or a case to a process; how to write one, to the rules a test binary asks of its files (names, CHECK and REQUIRE, linkage, static init, fakes, the state guard, process-wide fixtures); what al_add_test_binary's options are for; how a benchmark is written; and that an upstream TUT test is converted by hand. CLAUDE.md's and BUILD.md's tests sections say the tests are Catch2 and point at it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
Description
Stage 5's first step of the test framework's move from TUT to Catch2 (TM26): TUT is removed. Every test in the tree is Catch2 now, and how to write one is documented.
It is on develop, after #478 and #477.
llkdu's test (c63e717)
llimagej2ckdu_test, the last TUT test, is a Catch2 binary of its own. It compiles the codec in, over the test's stubs of llimage and of the KDU calls the codec makes, and links what the TUT test linked.AL_USE_KDU, and KDU has no vcpkg port yet, so the conversion is by hand and unchecked until a build with KDU exists.No test keeps
namespace tut(d1a287a)alincludesearch_data,llfontregistry_dataandllfontregistry_gl_data) move toll_testwith their friend declarations, beside the probes already there.namespace tut, in eight llcommon and llmessage test files, are anonymous, as everything local to a test file is.TUT goes (d0986e5)
externals/tutandll::tut;lltut.h,lltut.cpp,test.cpp,chained_callback.h,lltut_runner_lib);setenv.h, which nothing included;al_add_testandLLAddBuildTest.cmake. The library path a test runs with,AL_TEST_ENVIRONMENT, moves toALAddTestBinary.cmake.sync.h,namedtempfile.hand the other helpers Catch2 tests still use are listed with the harness.AL_TEST_CATCH2goes, and the TUT branches it chose between:sync.hfails a timeout withFAIL;newview_test_fakesnow links the harness for its headers, which the define used to hide from it.Comments (fdc261a)
lltut.h,test.cppas the main, fixtures made per test method, and the TUT banners.Docs (3186eb2)
doc/TESTING.mdis new. It covers:CHECKandREQUIRE, linkage, static init, fakes, the state guard, process-wide fixtures;al_add_test_binary's options;Related Issues
Issue Link: none. This follows #471, #472, #474, #475 and #478.
Checklist
Additional Notes
ctest -LE manualpass, and so do all 19 pending combined runs;scripts/testing/tut_parity.pycannot run without TUT.tut2catch.pyneeds a checkout from before this, since it parses a file with TUT's headers; TESTING.md says so.test_cost_report.py's default pattern still names the old executables. TM28, which measures with it, updates it.🤖 Generated with Claude Code