Paul Bakker | b06819b | 2011-01-18 16:18:38 +0000 | [diff] [blame] | 1 | set(libs |
Raef Coles | 995c66f | 2020-10-13 16:30:41 +0100 | [diff] [blame] | 2 | ${mbedtls_target} |
Paul Bakker | b06819b | 2011-01-18 16:18:38 +0000 | [diff] [blame] | 3 | ) |
| 4 | |
Ashley Duncan | d85a7e9 | 2019-04-29 20:35:06 +1200 | [diff] [blame] | 5 | # Set the project root directory if it's not already defined, as may happen if |
| 6 | # the tests folder is included directly by a parent project, without including |
| 7 | # the top level CMakeLists.txt. |
| 8 | if(NOT DEFINED MBEDTLS_DIR) |
| 9 | set(MBEDTLS_DIR ${CMAKE_SOURCE_DIR}) |
| 10 | endif() |
| 11 | |
okhowang(王沛文) | 3c1b090 | 2020-03-25 19:55:32 +0800 | [diff] [blame] | 12 | if(NOT MBEDTLS_PYTHON_EXECUTABLE) |
| 13 | message(FATAL_ERROR "Cannot build test suites without Python 3") |
Nicholas Wilson | 733676b | 2015-11-14 13:09:01 +0000 | [diff] [blame] | 14 | endif() |
| 15 | |
Manuel Pégourié-Gonnard | 313bcfc | 2021-09-07 12:16:49 +0200 | [diff] [blame] | 16 | # generated .data files will go there |
| 17 | file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/suites) |
| 18 | |
Gilles Peskine | cca6ce8 | 2022-09-18 23:08:38 +0200 | [diff] [blame] | 19 | # Get base names for generated files |
David Horstmann | 1732b5d | 2021-10-19 16:43:53 +0100 | [diff] [blame] | 20 | execute_process( |
| 21 | COMMAND |
David Horstmann | 3e30ad9 | 2021-10-20 16:53:58 +0100 | [diff] [blame] | 22 | ${MBEDTLS_PYTHON_EXECUTABLE} |
Werner Lewis | 8b2df74 | 2022-07-08 13:54:57 +0100 | [diff] [blame] | 23 | ${CMAKE_CURRENT_SOURCE_DIR}/../tests/scripts/generate_bignum_tests.py |
| 24 | --list-for-cmake |
Werner Lewis | 8b2df74 | 2022-07-08 13:54:57 +0100 | [diff] [blame] | 25 | WORKING_DIRECTORY |
| 26 | ${CMAKE_CURRENT_SOURCE_DIR}/.. |
| 27 | OUTPUT_VARIABLE |
Werner Lewis | 383461c | 2022-08-23 11:29:05 +0100 | [diff] [blame] | 28 | base_bignum_generated_data_files) |
Gilles Peskine | cca6ce8 | 2022-09-18 23:08:38 +0200 | [diff] [blame] | 29 | string(REGEX REPLACE "[^;]*/" "" |
| 30 | base_bignum_generated_data_files "${base_bignum_generated_data_files}") |
Werner Lewis | 8b2df74 | 2022-07-08 13:54:57 +0100 | [diff] [blame] | 31 | |
| 32 | execute_process( |
| 33 | COMMAND |
| 34 | ${MBEDTLS_PYTHON_EXECUTABLE} |
David Horstmann | 1732b5d | 2021-10-19 16:43:53 +0100 | [diff] [blame] | 35 | ${CMAKE_CURRENT_SOURCE_DIR}/../tests/scripts/generate_psa_tests.py |
| 36 | --list-for-cmake |
David Horstmann | 1732b5d | 2021-10-19 16:43:53 +0100 | [diff] [blame] | 37 | WORKING_DIRECTORY |
| 38 | ${CMAKE_CURRENT_SOURCE_DIR}/.. |
| 39 | OUTPUT_VARIABLE |
Werner Lewis | 383461c | 2022-08-23 11:29:05 +0100 | [diff] [blame] | 40 | base_psa_generated_data_files) |
Gilles Peskine | cca6ce8 | 2022-09-18 23:08:38 +0200 | [diff] [blame] | 41 | string(REGEX REPLACE "[^;]*/" "" |
| 42 | base_psa_generated_data_files "${base_psa_generated_data_files}") |
David Horstmann | 7570d24 | 2021-10-20 16:27:24 +0100 | [diff] [blame] | 43 | |
Gilles Peskine | cca6ce8 | 2022-09-18 23:08:38 +0200 | [diff] [blame] | 44 | # Derive generated file paths in the build directory. The generated data |
| 45 | # files go into the suites/ subdirectory. |
| 46 | set(base_generated_data_files |
| 47 | ${base_bignum_generated_data_files} ${base_psa_generated_data_files}) |
| 48 | string(REGEX REPLACE "([^;]+)" "suites/\\1" |
| 49 | all_generated_data_files "${base_generated_data_files}") |
Werner Lewis | 383461c | 2022-08-23 11:29:05 +0100 | [diff] [blame] | 50 | set(bignum_generated_data_files "") |
| 51 | set(psa_generated_data_files "") |
| 52 | foreach(file ${base_bignum_generated_data_files}) |
Gilles Peskine | cca6ce8 | 2022-09-18 23:08:38 +0200 | [diff] [blame] | 53 | list(APPEND bignum_generated_data_files ${CMAKE_CURRENT_BINARY_DIR}/suites/${file}) |
Werner Lewis | 383461c | 2022-08-23 11:29:05 +0100 | [diff] [blame] | 54 | endforeach() |
| 55 | foreach(file ${base_psa_generated_data_files}) |
Gilles Peskine | cca6ce8 | 2022-09-18 23:08:38 +0200 | [diff] [blame] | 56 | list(APPEND psa_generated_data_files ${CMAKE_CURRENT_BINARY_DIR}/suites/${file}) |
David Horstmann | 7570d24 | 2021-10-20 16:27:24 +0100 | [diff] [blame] | 57 | endforeach() |
David Horstmann | 1732b5d | 2021-10-19 16:43:53 +0100 | [diff] [blame] | 58 | |
David Horstmann | a8d1406 | 2021-10-20 17:14:23 +0100 | [diff] [blame] | 59 | if(GEN_FILES) |
Manuel Pégourié-Gonnard | e90e405 | 2021-09-08 13:27:09 +0200 | [diff] [blame] | 60 | add_custom_command( |
| 61 | OUTPUT |
Werner Lewis | 383461c | 2022-08-23 11:29:05 +0100 | [diff] [blame] | 62 | ${bignum_generated_data_files} |
| 63 | WORKING_DIRECTORY |
| 64 | ${CMAKE_CURRENT_SOURCE_DIR}/.. |
| 65 | COMMAND |
| 66 | ${MBEDTLS_PYTHON_EXECUTABLE} |
| 67 | ${CMAKE_CURRENT_SOURCE_DIR}/../tests/scripts/generate_bignum_tests.py |
| 68 | --directory ${CMAKE_CURRENT_BINARY_DIR}/suites |
| 69 | DEPENDS |
| 70 | ${CMAKE_CURRENT_SOURCE_DIR}/../tests/scripts/generate_bignum_tests.py |
Werner Lewis | 99e8178 | 2022-09-30 16:28:43 +0100 | [diff] [blame] | 71 | ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/mbedtls_dev/bignum_common.py |
| 72 | ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/mbedtls_dev/bignum_core.py |
Werner Lewis | 383461c | 2022-08-23 11:29:05 +0100 | [diff] [blame] | 73 | ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/mbedtls_dev/test_case.py |
Gilles Peskine | 64f2efd | 2022-09-16 21:41:47 +0200 | [diff] [blame] | 74 | ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/mbedtls_dev/test_data_generation.py |
Werner Lewis | 383461c | 2022-08-23 11:29:05 +0100 | [diff] [blame] | 75 | ) |
| 76 | add_custom_command( |
| 77 | OUTPUT |
| 78 | ${psa_generated_data_files} |
Manuel Pégourié-Gonnard | e90e405 | 2021-09-08 13:27:09 +0200 | [diff] [blame] | 79 | WORKING_DIRECTORY |
| 80 | ${CMAKE_CURRENT_SOURCE_DIR}/.. |
| 81 | COMMAND |
| 82 | ${MBEDTLS_PYTHON_EXECUTABLE} |
| 83 | ${CMAKE_CURRENT_SOURCE_DIR}/../tests/scripts/generate_psa_tests.py |
| 84 | --directory ${CMAKE_CURRENT_BINARY_DIR}/suites |
| 85 | DEPENDS |
| 86 | ${CMAKE_CURRENT_SOURCE_DIR}/../tests/scripts/generate_psa_tests.py |
Gilles Peskine | 26f9054 | 2022-03-15 16:39:51 +0100 | [diff] [blame] | 87 | ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/mbedtls_dev/crypto_knowledge.py |
| 88 | ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/mbedtls_dev/macro_collector.py |
| 89 | ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/mbedtls_dev/psa_storage.py |
| 90 | ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/mbedtls_dev/test_case.py |
Gilles Peskine | 64f2efd | 2022-09-16 21:41:47 +0200 | [diff] [blame] | 91 | ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/mbedtls_dev/test_data_generation.py |
Manuel Pégourié-Gonnard | e90e405 | 2021-09-08 13:27:09 +0200 | [diff] [blame] | 92 | ${CMAKE_CURRENT_SOURCE_DIR}/../include/psa/crypto_config.h |
| 93 | ${CMAKE_CURRENT_SOURCE_DIR}/../include/psa/crypto_values.h |
| 94 | ${CMAKE_CURRENT_SOURCE_DIR}/../include/psa/crypto_extra.h |
| 95 | ) |
Jerry Yu | 80bc860 | 2022-01-17 18:26:52 +0800 | [diff] [blame] | 96 | |
Manuel Pégourié-Gonnard | e90e405 | 2021-09-08 13:27:09 +0200 | [diff] [blame] | 97 | else() |
Gilles Peskine | cca6ce8 | 2022-09-18 23:08:38 +0200 | [diff] [blame] | 98 | foreach(file ${all_generated_data_files}) |
David Horstmann | 1732b5d | 2021-10-19 16:43:53 +0100 | [diff] [blame] | 99 | link_to_source(${file}) |
| 100 | endforeach() |
Manuel Pégourié-Gonnard | e90e405 | 2021-09-08 13:27:09 +0200 | [diff] [blame] | 101 | endif() |
Jerry Yu | 3b86d1b | 2022-03-02 10:40:41 +0800 | [diff] [blame] | 102 | # CMake generates sub-makefiles for each target and calls them in subprocesses. |
| 103 | # Without this command, cmake will generate rules in each sub-makefile. As a result, |
| 104 | # they can cause race conditions in parallel builds. |
| 105 | # With this line, only 4 sub-makefiles include the above command, that reduces |
| 106 | # the risk of a race. |
Werner Lewis | 383461c | 2022-08-23 11:29:05 +0100 | [diff] [blame] | 107 | add_custom_target(test_suite_bignum_generated_data DEPENDS ${bignum_generated_data_files}) |
| 108 | add_custom_target(test_suite_psa_generated_data DEPENDS ${psa_generated_data_files}) |
Gilles Peskine | ac372cc | 2018-11-29 10:15:06 +0000 | [diff] [blame] | 109 | # Test suites caught by SKIP_TEST_SUITES are built but not executed. |
| 110 | # "foo" as a skip pattern skips "test_suite_foo" and "test_suite_foo.bar" |
| 111 | # but not "test_suite_foobar". |
| 112 | string(REGEX REPLACE "[ ,;]" "|" SKIP_TEST_SUITES_REGEX "${SKIP_TEST_SUITES}") |
| 113 | string(REPLACE "." "\\." SKIP_TEST_SUITES_REGEX "${SKIP_TEST_SUITES_REGEX}") |
| 114 | set(SKIP_TEST_SUITES_REGEX "^(${SKIP_TEST_SUITES_REGEX})(\$|\\.)") |
| 115 | |
Paul Bakker | 7304376 | 2011-07-13 15:03:10 +0000 | [diff] [blame] | 116 | function(add_test_suite suite_name) |
| 117 | if(ARGV1) |
Manuel Pégourié-Gonnard | 216a183 | 2015-06-25 09:20:03 +0200 | [diff] [blame] | 118 | set(data_name ${ARGV1}) |
Paul Bakker | 7304376 | 2011-07-13 15:03:10 +0000 | [diff] [blame] | 119 | else() |
Manuel Pégourié-Gonnard | 216a183 | 2015-06-25 09:20:03 +0200 | [diff] [blame] | 120 | set(data_name ${suite_name}) |
Paul Bakker | 46c1794 | 2011-07-13 14:54:54 +0000 | [diff] [blame] | 121 | endif() |
| 122 | |
David Horstmann | ae7bd35 | 2021-10-19 19:05:42 +0100 | [diff] [blame] | 123 | # Get the test names of the tests with generated .data files |
| 124 | # from the generated_data_files list in parent scope. |
Werner Lewis | 383461c | 2022-08-23 11:29:05 +0100 | [diff] [blame] | 125 | set(bignum_generated_data_names "") |
| 126 | set(psa_generated_data_names "") |
| 127 | foreach(generated_data_file ${bignum_generated_data_files}) |
David Horstmann | ae7bd35 | 2021-10-19 19:05:42 +0100 | [diff] [blame] | 128 | # Get the plain filename |
| 129 | get_filename_component(generated_data_name ${generated_data_file} NAME) |
| 130 | # Remove the ".data" extension |
| 131 | get_name_without_last_ext(generated_data_name ${generated_data_name}) |
| 132 | # Remove leading "test_suite_" |
| 133 | string(SUBSTRING ${generated_data_name} 11 -1 generated_data_name) |
Werner Lewis | 383461c | 2022-08-23 11:29:05 +0100 | [diff] [blame] | 134 | list(APPEND bignum_generated_data_names ${generated_data_name}) |
| 135 | endforeach() |
| 136 | foreach(generated_data_file ${psa_generated_data_files}) |
| 137 | # Get the plain filename |
| 138 | get_filename_component(generated_data_name ${generated_data_file} NAME) |
| 139 | # Remove the ".data" extension |
| 140 | get_name_without_last_ext(generated_data_name ${generated_data_name}) |
| 141 | # Remove leading "test_suite_" |
| 142 | string(SUBSTRING ${generated_data_name} 11 -1 generated_data_name) |
| 143 | list(APPEND psa_generated_data_names ${generated_data_name}) |
David Horstmann | ae7bd35 | 2021-10-19 19:05:42 +0100 | [diff] [blame] | 144 | endforeach() |
| 145 | |
Werner Lewis | 383461c | 2022-08-23 11:29:05 +0100 | [diff] [blame] | 146 | if(";${bignum_generated_data_names};" MATCHES ";${data_name};") |
Manuel Pégourié-Gonnard | ce3ba8f | 2021-05-14 12:03:37 +0200 | [diff] [blame] | 147 | set(data_file |
| 148 | ${CMAKE_CURRENT_BINARY_DIR}/suites/test_suite_${data_name}.data) |
Werner Lewis | 383461c | 2022-08-23 11:29:05 +0100 | [diff] [blame] | 149 | set(dependency test_suite_bignum_generated_data) |
| 150 | elseif(";${psa_generated_data_names};" MATCHES ";${data_name};") |
| 151 | set(data_file |
| 152 | ${CMAKE_CURRENT_BINARY_DIR}/suites/test_suite_${data_name}.data) |
| 153 | set(dependency test_suite_psa_generated_data) |
Manuel Pégourié-Gonnard | ce3ba8f | 2021-05-14 12:03:37 +0200 | [diff] [blame] | 154 | else() |
| 155 | set(data_file |
| 156 | ${CMAKE_CURRENT_SOURCE_DIR}/suites/test_suite_${data_name}.data) |
Werner Lewis | 383461c | 2022-08-23 11:29:05 +0100 | [diff] [blame] | 157 | set(dependency test_suite_bignum_generated_data test_suite_psa_generated_data) |
Manuel Pégourié-Gonnard | ce3ba8f | 2021-05-14 12:03:37 +0200 | [diff] [blame] | 158 | endif() |
| 159 | |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 160 | add_custom_command( |
Manuel Pégourié-Gonnard | 42681f3 | 2021-05-14 10:53:43 +0200 | [diff] [blame] | 161 | OUTPUT |
David Horstmann | f602eb1 | 2021-10-20 16:40:56 +0100 | [diff] [blame] | 162 | # The output filename of generate_test_code.py is derived from the -d |
| 163 | # input argument. |
Manuel Pégourié-Gonnard | 42681f3 | 2021-05-14 10:53:43 +0200 | [diff] [blame] | 164 | test_suite_${data_name}.c |
| 165 | COMMAND |
| 166 | ${MBEDTLS_PYTHON_EXECUTABLE} |
| 167 | ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_test_code.py |
| 168 | -f ${CMAKE_CURRENT_SOURCE_DIR}/suites/test_suite_${suite_name}.function |
Manuel Pégourié-Gonnard | ce3ba8f | 2021-05-14 12:03:37 +0200 | [diff] [blame] | 169 | -d ${data_file} |
Manuel Pégourié-Gonnard | 42681f3 | 2021-05-14 10:53:43 +0200 | [diff] [blame] | 170 | -t ${CMAKE_CURRENT_SOURCE_DIR}/suites/main_test.function |
| 171 | -p ${CMAKE_CURRENT_SOURCE_DIR}/suites/host_test.function |
| 172 | -s ${CMAKE_CURRENT_SOURCE_DIR}/suites |
| 173 | --helpers-file ${CMAKE_CURRENT_SOURCE_DIR}/suites/helpers.function |
| 174 | -o . |
| 175 | DEPENDS |
| 176 | ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_test_code.py |
| 177 | ${CMAKE_CURRENT_SOURCE_DIR}/suites/test_suite_${suite_name}.function |
Manuel Pégourié-Gonnard | ce3ba8f | 2021-05-14 12:03:37 +0200 | [diff] [blame] | 178 | ${data_file} |
Manuel Pégourié-Gonnard | 42681f3 | 2021-05-14 10:53:43 +0200 | [diff] [blame] | 179 | ${CMAKE_CURRENT_SOURCE_DIR}/suites/main_test.function |
| 180 | ${CMAKE_CURRENT_SOURCE_DIR}/suites/host_test.function |
| 181 | ${CMAKE_CURRENT_SOURCE_DIR}/suites/helpers.function |
| 182 | ${mbedtls_target} |
Manuel Pégourié-Gonnard | 389150d | 2021-09-09 10:51:16 +0200 | [diff] [blame] | 183 | BYPRODUCTS |
| 184 | test_suite_${data_name}.datax |
Paul Bakker | 4c14a25 | 2010-06-18 22:54:05 +0000 | [diff] [blame] | 185 | ) |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 186 | |
Ronald Cron | f5ea29a | 2020-06-19 10:42:29 +0200 | [diff] [blame] | 187 | add_executable(test_suite_${data_name} test_suite_${data_name}.c $<TARGET_OBJECTS:mbedtls_test>) |
Werner Lewis | 383461c | 2022-08-23 11:29:05 +0100 | [diff] [blame] | 188 | add_dependencies(test_suite_${data_name} ${dependency}) |
Paul Bakker | 7304376 | 2011-07-13 15:03:10 +0000 | [diff] [blame] | 189 | target_link_libraries(test_suite_${data_name} ${libs}) |
Gilles Peskine | 76dd3aa | 2020-07-02 15:58:37 +0200 | [diff] [blame] | 190 | # Include test-specific header files from ./include and private header |
| 191 | # files (used by some invasive tests) from ../library. Public header |
| 192 | # files are automatically included because the library targets declare |
| 193 | # them as PUBLIC. |
Ronald Cron | 8552741 | 2020-05-15 17:20:47 +0200 | [diff] [blame] | 194 | target_include_directories(test_suite_${data_name} |
| 195 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include |
| 196 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../library) |
| 197 | |
Gilles Peskine | ac372cc | 2018-11-29 10:15:06 +0000 | [diff] [blame] | 198 | if(${data_name} MATCHES ${SKIP_TEST_SUITES_REGEX}) |
| 199 | message(STATUS "The test suite ${data_name} will not be executed.") |
| 200 | else() |
| 201 | add_test(${data_name}-suite test_suite_${data_name} --verbose) |
| 202 | endif() |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 203 | endfunction(add_test_suite) |
| 204 | |
Manuel Pégourié-Gonnard | 42681f3 | 2021-05-14 10:53:43 +0200 | [diff] [blame] | 205 | # Enable definition of various functions used throughout the testsuite |
| 206 | # (gethostname, strdup, fileno...) even when compiling with -std=c99. Harmless |
| 207 | # on non-POSIX platforms. |
| 208 | add_definitions("-D_POSIX_C_SOURCE=200809L") |
| 209 | |
Gilles Peskine | f29019f | 2021-02-23 13:44:41 +0100 | [diff] [blame] | 210 | if(CMAKE_COMPILER_IS_CLANG) |
| 211 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wdocumentation -Wno-documentation-deprecated-sync -Wunreachable-code") |
| 212 | endif(CMAKE_COMPILER_IS_CLANG) |
| 213 | |
Manuel Pégourié-Gonnard | 3083053 | 2015-07-01 17:06:28 +0200 | [diff] [blame] | 214 | if(MSVC) |
Simon B | 9b3e3c4 | 2016-11-03 01:12:50 +0000 | [diff] [blame] | 215 | # If a warning level has been defined, suppress all warnings for test code |
| 216 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W0") |
| 217 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX-") |
Manuel Pégourié-Gonnard | 3083053 | 2015-07-01 17:06:28 +0200 | [diff] [blame] | 218 | endif(MSVC) |
| 219 | |
Gilles Peskine | 29080e8 | 2022-01-25 22:30:25 +0100 | [diff] [blame] | 220 | file(GLOB test_suites RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" suites/*.data) |
Gilles Peskine | cca6ce8 | 2022-09-18 23:08:38 +0200 | [diff] [blame] | 221 | list(APPEND test_suites ${all_generated_data_files}) |
Gilles Peskine | 29080e8 | 2022-01-25 22:30:25 +0100 | [diff] [blame] | 222 | # If the generated .data files are present in the source tree, we just added |
Gilles Peskine | cca6ce8 | 2022-09-18 23:08:38 +0200 | [diff] [blame] | 223 | # them twice, both through GLOB and through ${all_generated_data_files}. |
Gilles Peskine | 29080e8 | 2022-01-25 22:30:25 +0100 | [diff] [blame] | 224 | list(REMOVE_DUPLICATES test_suites) |
| 225 | list(SORT test_suites) |
| 226 | foreach(test_suite ${test_suites}) |
Gilles Peskine | cd55fe0 | 2022-01-25 23:13:49 +0100 | [diff] [blame] | 227 | get_filename_component(data_name ${test_suite} NAME) |
Gilles Peskine | a18fb9d | 2022-01-25 23:24:34 +0100 | [diff] [blame] | 228 | string(REGEX REPLACE "\\.data\$" "" data_name "${data_name}") |
Gilles Peskine | cd55fe0 | 2022-01-25 23:13:49 +0100 | [diff] [blame] | 229 | string(REPLACE "test_suite_" "" data_name "${data_name}") |
| 230 | string(REGEX MATCH "[^.]*" function_name "${data_name}") |
Gilles Peskine | 29080e8 | 2022-01-25 22:30:25 +0100 | [diff] [blame] | 231 | add_test_suite(${function_name} ${data_name}) |
| 232 | endforeach(test_suite) |
Paul Bakker | cd6d69a | 2014-02-06 15:43:21 +0100 | [diff] [blame] | 233 | |
Gilles Peskine | 8405257 | 2018-03-21 12:12:47 +0100 | [diff] [blame] | 234 | # Make scripts and data files needed for testing available in an |
| 235 | # out-of-source build. |
Paul Bakker | cd6d69a | 2014-02-06 15:43:21 +0100 | [diff] [blame] | 236 | if (NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) |
Andrzej Kurek | 4a71cfa | 2019-05-06 05:06:06 -0400 | [diff] [blame] | 237 | if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/seedfile") |
| 238 | link_to_source(seedfile) |
| 239 | endif() |
Gilles Peskine | 8405257 | 2018-03-21 12:12:47 +0100 | [diff] [blame] | 240 | link_to_source(compat.sh) |
David Brown | c744418 | 2020-10-16 13:19:49 -0600 | [diff] [blame] | 241 | link_to_source(context-info.sh) |
Gilles Peskine | 8405257 | 2018-03-21 12:12:47 +0100 | [diff] [blame] | 242 | link_to_source(data_files) |
| 243 | link_to_source(scripts) |
| 244 | link_to_source(ssl-opt.sh) |
Jerry Yu | 55ee769 | 2021-11-29 13:26:55 +0800 | [diff] [blame] | 245 | link_to_source(opt-testcases) |
Paul Bakker | cd6d69a | 2014-02-06 15:43:21 +0100 | [diff] [blame] | 246 | endif() |