cmcfarlen commented on code in PR #13658:
URL: https://github.com/apache/trafficserver/pull/13658#discussion_r3973346149
##########
src/iocore/hostdb/unit_tests/CMakeLists.txt:
##########
@@ -35,4 +35,6 @@ target_include_directories(test_RefCountCache PRIVATE
"${CMAKE_CURRENT_SOURCE_DI
target_link_libraries(
test_RefCountCache PRIVATE ts::tscore ts::tsutil ts::inkevent configmanager
Catch2::Catch2WithMain
)
-add_catch2_test(NAME test_hostdb_RefCountCache COMMAND
$<TARGET_FILE:test_RefCountCache>)
+# test_RefCountCache has its own main() and is not a Catch2 runner, so it
cannot
+# be split into per-case ctest entries.
+add_test(NAME test_hostdb_RefCountCache COMMAND
$<TARGET_FILE:test_RefCountCache>)
Review Comment:
Fixed in 29169dfa6e, and the comment was accurate — `test_RefCountCache.cc`
has its own `main()` at line 261 and contains no Catch2 whatsoever (no include,
no `TEST_CASE`, no assertion macros). So rather than switching to
`Catch2::Catch2`, I dropped the Catch2 dependency entirely.
On the duplicate-symbol concern: it didn't actually manifest, because
Catch2's `main` lives in its own object inside a static library, and the linker
never pulls that object once the TU supplies `main`. The dependency was simply
dead weight. Test still passes after removal.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]