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" ) 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} ) 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)