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>
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index ef484f6..4e44f88 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -16,16 +16,17 @@
 # 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 @@
             ${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.