Fix comment issues

Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
This commit is contained in:
Cristian Le 2024-03-06 10:44:25 +01:00
parent 3cf405b60d
commit 96b4b11ed1
Failed to extract signature

View File

@ -120,6 +120,8 @@ function(catch_discover_tests_impl)
string(JSON tests_length LENGTH "${tests}") string(JSON tests_length LENGTH "${tests}")
# CMake foreach loop is inclusive # CMake foreach loop is inclusive
math(EXPR test_end "${tests_length} - 1") math(EXPR test_end "${tests_length} - 1")
# Accumulate test names
set(tests_list)
# Parse output # Parse output
foreach(index RANGE "${test_end}") foreach(index RANGE "${test_end}")
string(JSON test_spec GET "${tests}" "${index}") string(JSON test_spec GET "${tests}" "${index}")
@ -130,6 +132,7 @@ function(catch_discover_tests_impl)
foreach(char \\ , [ ]) foreach(char \\ , [ ])
string(REPLACE ${char} "\\${char}" test_name "${test_name}") string(REPLACE ${char} "\\${char}" test_name "${test_name}")
endforeach(char) endforeach(char)
list(APPEND tests_list "${test_name}")
# ...add output dir # ...add output dir
if(output_dir) if(output_dir)
string(REGEX REPLACE "[^A-Za-z0-9_]" "_" test_name_clean "${test_name}") 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 add_command(set_tests_properties
"${prefix}${test}${suffix}" "${prefix}${test}${suffix}"
PROPERTIES PROPERTIES
LABELS "${tags}" LABELS "${tag}"
) )
endforeach() endforeach()
endif() 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 # Create a list of all discovered tests, which users may use to e.g. set
# properties on the tests # properties on the tests
add_command(set ${_TEST_LIST} ${tests}) add_command(set ${_TEST_LIST} ${tests_list})
# Write CTest script # Write CTest script
file(WRITE "${_CTEST_FILE}" "${script}") file(WRITE "${_CTEST_FILE}" "${script}")