From 96b4b11ed14ff83ec8253da3ab3959f3ab89e2a1 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Wed, 6 Mar 2024 10:44:25 +0100 Subject: [PATCH] Fix comment issues Signed-off-by: Cristian Le --- extras/CatchAddTests.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/extras/CatchAddTests.cmake b/extras/CatchAddTests.cmake index 99649227..0b64fcc2 100644 --- a/extras/CatchAddTests.cmake +++ b/extras/CatchAddTests.cmake @@ -120,6 +120,8 @@ function(catch_discover_tests_impl) string(JSON tests_length LENGTH "${tests}") # CMake foreach loop is inclusive math(EXPR test_end "${tests_length} - 1") + # Accumulate test names + set(tests_list) # Parse output foreach(index RANGE "${test_end}") string(JSON test_spec GET "${tests}" "${index}") @@ -130,6 +132,7 @@ function(catch_discover_tests_impl) foreach(char \\ , [ ]) string(REPLACE ${char} "\\${char}" test_name "${test_name}") endforeach(char) + list(APPEND tests_list "${test_name}") # ...add output dir if(output_dir) string(REGEX REPLACE "[^A-Za-z0-9_]" "_" test_name_clean "${test_name}") @@ -173,7 +176,7 @@ function(catch_discover_tests_impl) add_command(set_tests_properties "${prefix}${test}${suffix}" PROPERTIES - LABELS "${tags}" + LABELS "${tag}" ) endforeach() endif() @@ -181,7 +184,7 @@ function(catch_discover_tests_impl) # Create a list of all discovered tests, which users may use to e.g. set # properties on the tests - add_command(set ${_TEST_LIST} ${tests}) + add_command(set ${_TEST_LIST} ${tests_list}) # Write CTest script file(WRITE "${_CTEST_FILE}" "${script}")