From 1732b5d6ee51aa6bb7c7b61bf265864c79ebbdab Mon Sep 17 00:00:00 2001 From: David Horstmann Date: Tue, 19 Oct 2021 16:43:53 +0100 Subject: [PATCH] Move test link_to_source() calls into a foreach This removes a hardcoded list of generated test names Signed-off-by: David Horstmann --- tests/CMakeLists.txt | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ef484f68e..4e44f8821 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -16,16 +16,17 @@ endif() # generated .data files will go there file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/suites) +execute_process( + COMMAND + ${CMAKE_CURRENT_SOURCE_DIR}/../tests/scripts/generate_psa_tests.py + --list-for-cmake + --directory ${CMAKE_CURRENT_BINARY_DIR}/suites + WORKING_DIRECTORY + ${CMAKE_CURRENT_SOURCE_DIR}/.. + OUTPUT_VARIABLE + test_suite_data_files) + if(DEV_MODE) - execute_process( - COMMAND - ${CMAKE_CURRENT_SOURCE_DIR}/../tests/scripts/generate_psa_tests.py - --list-for-cmake - --directory ${CMAKE_CURRENT_BINARY_DIR}/suites - WORKING_DIRECTORY - ${CMAKE_CURRENT_SOURCE_DIR}/.. - OUTPUT_VARIABLE - test_suite_data_files) add_custom_command( OUTPUT ${test_suite_data_files} @@ -42,9 +43,9 @@ if(DEV_MODE) ${CMAKE_CURRENT_SOURCE_DIR}/../include/psa/crypto_extra.h ) else() - link_to_source(suites/test_suite_psa_crypto_not_supported.generated.data) - link_to_source(suites/test_suite_psa_crypto_storage_format.current.data) - link_to_source(suites/test_suite_psa_crypto_storage_format.v0.data) + foreach(file ${test_suite_data_files}) + link_to_source(${file}) + endforeach() endif() # Test suites caught by SKIP_TEST_SUITES are built but not executed.