@@ -74,7 +74,7 @@ add_library(runner STATIC ${librunner_la_SOURCES})
74
74
target_compile_definitions (runner PRIVATE "${CRYPTO_BACKEND_DEFINE} " )
75
75
target_include_directories (runner PRIVATE "${CMAKE_CURRENT_BINARY_DIR} /../src" "../src" "../include" "${CRYPTO_BACKEND_INCLUDE_DIR} " )
76
76
77
- foreach (test ${ DOCKER_TESTS} ${ STANDALONE_TESTS} ${ SSHD_TESTS} )
77
+ foreach (test IN LISTS DOCKER_TESTS STANDALONE_TESTS SSHD_TESTS)
78
78
if (NOT ";${DOCKER_TESTS_STATIC} ;${STANDALONE_TESTS_STATIC} ;" MATCHES ";${test} ;" )
79
79
set (LIB_FOR_TESTS ${LIB_SELECTED} )
80
80
elseif (TARGET ${LIB_STATIC} )
@@ -107,15 +107,15 @@ endforeach()
107
107
option (RUN_DOCKER_TESTS "Run tests requiring Docker" ON )
108
108
109
109
if (RUN_DOCKER_TESTS)
110
- foreach (test ${ DOCKER_TESTS} )
110
+ foreach (test IN LISTS DOCKER_TESTS)
111
111
if (TARGET ${test} )
112
112
add_test (NAME ${test} COMMAND "$<TARGET_FILE:${test} >" )
113
113
set_property (TEST ${test} APPEND PROPERTY ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR} " )
114
114
endif ()
115
115
endforeach ()
116
116
endif ()
117
117
118
- foreach (test ${ STANDALONE_TESTS} )
118
+ foreach (test IN LISTS STANDALONE_TESTS)
119
119
if (TARGET ${test} )
120
120
add_test (NAME ${test} COMMAND "$<TARGET_FILE:${test} >" )
121
121
set_property (TEST ${test} APPEND PROPERTY ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR} " )
@@ -124,7 +124,7 @@ endforeach()
124
124
125
125
if (RUN_SSHD_TESTS AND SSHD_EXECUTABLE)
126
126
unset (sshd_test_targets)
127
- foreach (test ${ SSHD_TESTS} )
127
+ foreach (test IN LISTS SSHD_TESTS)
128
128
if (TARGET ${test} )
129
129
set (sshd_test_targets "${sshd_test_targets} $<TARGET_FILE:${test} >" )
130
130
endif ()
@@ -141,14 +141,16 @@ if(RUN_DOCKER_TESTS)
141
141
# CRYPT/MAC algo tests
142
142
file (READ "test_read_algos.txt" ALGO_TESTS)
143
143
string (REGEX REPLACE "\\\n " ";" ALGO_TESTS ${ALGO_TESTS} )
144
- foreach (test ${ALGO_TESTS} )
145
- set (testname "test_read-${test} " )
146
- add_test (NAME ${testname} COMMAND "$<TARGET_FILE:test_read>" )
147
- set_property (TEST ${testname} APPEND PROPERTY ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR} " )
148
- if (test MATCHES "mac-" )
149
- set_property (TEST ${testname} APPEND PROPERTY ENVIRONMENT "FIXTURE_TEST_MAC=${test} " )
150
- else ()
151
- set_property (TEST ${testname} APPEND PROPERTY ENVIRONMENT "FIXTURE_TEST_CRYPT=${test} " )
144
+ foreach (test IN LISTS ALGO_TESTS)
145
+ if (test )
146
+ set (testname "test_read-${test} " )
147
+ add_test (NAME ${testname} COMMAND "$<TARGET_FILE:test_read>" )
148
+ set_property (TEST ${testname} APPEND PROPERTY ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR} " )
149
+ if (test MATCHES "mac-" )
150
+ set_property (TEST ${testname} APPEND PROPERTY ENVIRONMENT "FIXTURE_TEST_MAC=${test} " )
151
+ else ()
152
+ set_property (TEST ${testname} APPEND PROPERTY ENVIRONMENT "FIXTURE_TEST_CRYPT=${test} " )
153
+ endif ()
152
154
endif ()
153
155
endforeach ()
154
156
endif ()
0 commit comments