From 271a5535fb824691a0aaa052d485cedec6895a4c Mon Sep 17 00:00:00 2001 From: Lee Sang Gyu Date: Fri, 6 Nov 2026 01:26:07 +0900 Subject: [PATCH 1/3] catch_discover_tests: keep EXTRA_ARGS as separate arguments The runtime test command passed EXTRA_ARGS as one quoted value, so a list such as --success --durations yes reached the test executable as a single argument. Expand the list again so each element is its own argument. --- extras/CatchAddTests.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/CatchAddTests.cmake b/extras/CatchAddTests.cmake index aba0d0019b..764da957a5 100644 --- a/extras/CatchAddTests.cmake +++ b/extras/CatchAddTests.cmake @@ -404,7 +404,7 @@ function(catch_discover_tests_impl) "${_TEST_EXECUTABLE}" ) prepare_command_fragment(_args_reporter_fragment - "${extra_args}" + ${extra_args} "${reporter_arg}" "--order decl" ) From 958aa5189e0554e84693ca5b082d340eb474a16f Mon Sep 17 00:00:00 2001 From: Lee Sang Gyu Date: Fri, 6 Nov 2026 01:26:26 +0900 Subject: [PATCH 2/3] tests: pass several EXTRA_ARGS in the discovery fixture Add EXTRA_ARGS --success --durations yes to the DiscoverTests fixture. --- tests/TestScripts/DiscoverTests/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/TestScripts/DiscoverTests/CMakeLists.txt b/tests/TestScripts/DiscoverTests/CMakeLists.txt index 8ae0decb67..bf4f16d5b1 100644 --- a/tests/TestScripts/DiscoverTests/CMakeLists.txt +++ b/tests/TestScripts/DiscoverTests/CMakeLists.txt @@ -18,6 +18,7 @@ catch_discover_tests( TEST_PREFIX " prefix " TEST_SUFFIX " suffix " ADD_TAGS_AS_LABELS + EXTRA_ARGS --success --durations yes DISCOVERY_MODE PRE_TEST ${extra_args} ) From e1e31babf6ee25c83ec07d05f1b548d4103e12b5 Mon Sep 17 00:00:00 2001 From: Lee Sang Gyu Date: Fri, 6 Nov 2026 01:26:45 +0900 Subject: [PATCH 3/3] tests: check the EXTRA_ARGS command tail and run one discovered test Assert the exact arguments after the test filter and run one registered test with ctest. --- tests/TestScripts/DiscoverTests/VerifyRegistration.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/TestScripts/DiscoverTests/VerifyRegistration.py b/tests/TestScripts/DiscoverTests/VerifyRegistration.py index e213bd3d83..c0b9674b4a 100644 --- a/tests/TestScripts/DiscoverTests/VerifyRegistration.py +++ b/tests/TestScripts/DiscoverTests/VerifyRegistration.py @@ -130,10 +130,11 @@ def extract_tests_from_ctest(ctest_output) -> List[TestInfo]: for test in tests: test_command = test['command'] # First part of the command is the binary, second is the filter, - # third is the `--order decl` arg for faster startup. + # followed by three EXTRA_ARGS and `--order decl` for faster startup. # If there are less, registration has failed. If there are more, # registration has changed and the script needs updating. - assert len(test_command) == 3, test_command + assert len(test_command) == 6, test_command + assert test_command[2:] == ['--success', '--durations', 'yes', '--order decl'], test_command test_name = test_command[1] labels = [] for prop in test['properties']: @@ -302,3 +303,7 @@ def escape_catch2_test_names(infos: List[TestInfo]): cmake_version = get_cmake_version() if cmake_version >= (3, 27): check_DL_PATHS(ctest_output) + + subprocess.run(['ctest', '--test-dir', build_path, '-C', 'Debug', + '-R', '^ prefix Some test suffix $', + '--output-on-failure'], check=True)