Move test link_to_source() calls into a foreach

This removes a hardcoded list of generated test names

Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
David Horstmann 2021-10-19 16:43:53 +01:00
parent 7b78ec88a4
commit 1732b5d6ee

View file

@ -16,16 +16,17 @@ endif()
# generated .data files will go there # generated .data files will go there
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/suites) 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) 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( add_custom_command(
OUTPUT OUTPUT
${test_suite_data_files} ${test_suite_data_files}
@ -42,9 +43,9 @@ if(DEV_MODE)
${CMAKE_CURRENT_SOURCE_DIR}/../include/psa/crypto_extra.h ${CMAKE_CURRENT_SOURCE_DIR}/../include/psa/crypto_extra.h
) )
else() else()
link_to_source(suites/test_suite_psa_crypto_not_supported.generated.data) foreach(file ${test_suite_data_files})
link_to_source(suites/test_suite_psa_crypto_storage_format.current.data) link_to_source(${file})
link_to_source(suites/test_suite_psa_crypto_storage_format.v0.data) endforeach()
endif() endif()
# Test suites caught by SKIP_TEST_SUITES are built but not executed. # Test suites caught by SKIP_TEST_SUITES are built but not executed.