Remove mbedtls_test
Use tf_psa_crypto_test instead.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 15370c5..13f687e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -412,54 +412,6 @@
# to define the test executables.
#
if(ENABLE_TESTING OR ENABLE_PROGRAMS)
- file(GLOB MBEDTLS_TEST_FILES
- ${CMAKE_CURRENT_SOURCE_DIR}/tests/src/*.c
- ${CMAKE_CURRENT_SOURCE_DIR}/tests/src/drivers/*.c)
- add_library(mbedtls_test OBJECT ${MBEDTLS_TEST_FILES})
- set_base_compile_options(mbedtls_test)
- if(GEN_FILES)
- add_custom_command(
- OUTPUT
- ${CMAKE_CURRENT_SOURCE_DIR}/tests/src/test_keys.h
- WORKING_DIRECTORY
- ${CMAKE_CURRENT_SOURCE_DIR}/tests
- COMMAND
- "${MBEDTLS_PYTHON_EXECUTABLE}"
- "${MBEDTLS_FRAMEWORK_DIR}/scripts/generate_test_keys.py"
- "--output"
- "${CMAKE_CURRENT_SOURCE_DIR}/tests/src/test_keys.h"
- DEPENDS
- ${MBEDTLS_FRAMEWORK_DIR}/scripts/generate_test_keys.py
- )
- add_custom_target(test_keys_header DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tests/src/test_keys.h)
- add_custom_command(
- OUTPUT
- ${CMAKE_CURRENT_SOURCE_DIR}/tests/src/test_certs.h
- WORKING_DIRECTORY
- ${CMAKE_CURRENT_SOURCE_DIR}/tests
- COMMAND
- "${MBEDTLS_PYTHON_EXECUTABLE}"
- "${MBEDTLS_FRAMEWORK_DIR}/scripts/generate_test_cert_macros.py"
- "--output"
- "${CMAKE_CURRENT_SOURCE_DIR}/tests/src/test_certs.h"
- DEPENDS
- ${MBEDTLS_FRAMEWORK_DIR}/scripts/generate_test_cert_macros.py
- )
- add_custom_target(test_certs_header DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tests/src/test_certs.h)
- add_dependencies(mbedtls_test test_keys_header test_certs_header)
- endif()
- target_include_directories(mbedtls_test
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests/include
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/include
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/drivers/builtin/include
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/drivers/everest/include
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/library
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/core
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/drivers/builtin/src)
- # Request C11, needed for memory poisoning tests
- set_target_properties(mbedtls_test PROPERTIES C_STANDARD 11)
-
file(GLOB MBEDTLS_TEST_HELPER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/tests/src/test_helpers/*.c)
add_library(mbedtls_test_helpers OBJECT ${MBEDTLS_TEST_HELPER_FILES})
@@ -474,7 +426,6 @@
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/drivers/builtin/src
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/drivers/everest/include)
- set_config_files_compile_definitions(mbedtls_test)
set_config_files_compile_definitions(mbedtls_test_helpers)
endif()
diff --git a/programs/aes/CMakeLists.txt b/programs/aes/CMakeLists.txt
index 728b4d0..ca1b30f 100644
--- a/programs/aes/CMakeLists.txt
+++ b/programs/aes/CMakeLists.txt
@@ -4,7 +4,7 @@
add_dependencies(${programs_target} ${executables})
foreach(exe IN LISTS executables)
- add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
+ add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:tf_psa_crypto_test>)
set_base_compile_options(${exe})
target_link_libraries(${exe} ${tfpsacrypto_target} ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
diff --git a/programs/cipher/CMakeLists.txt b/programs/cipher/CMakeLists.txt
index ff8c76d..bd659b4 100644
--- a/programs/cipher/CMakeLists.txt
+++ b/programs/cipher/CMakeLists.txt
@@ -4,7 +4,7 @@
add_dependencies(${programs_target} ${executables})
foreach(exe IN LISTS executables)
- add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
+ add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:tf_psa_crypto_test>)
set_base_compile_options(${exe})
target_link_libraries(${exe} ${tfpsacrypto_target} ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
diff --git a/programs/fuzz/CMakeLists.txt b/programs/fuzz/CMakeLists.txt
index 44fff9a..722698a 100644
--- a/programs/fuzz/CMakeLists.txt
+++ b/programs/fuzz/CMakeLists.txt
@@ -28,7 +28,7 @@
foreach(exe IN LISTS executables_no_common_c executables_with_common_c)
- set(exe_sources ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
+ set(exe_sources ${exe}.c $<TARGET_OBJECTS:tf_psa_crypto_test>)
if(NOT FUZZINGENGINE_LIB)
list(APPEND exe_sources onefile.c)
endif()
diff --git a/programs/hash/CMakeLists.txt b/programs/hash/CMakeLists.txt
index 498efc9..419d484 100644
--- a/programs/hash/CMakeLists.txt
+++ b/programs/hash/CMakeLists.txt
@@ -6,7 +6,7 @@
add_dependencies(${programs_target} ${executables})
foreach(exe IN LISTS executables)
- add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
+ add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:tf_psa_crypto_test>)
set_base_compile_options(${exe})
target_link_libraries(${exe} ${tfpsacrypto_target} ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
diff --git a/programs/pkey/CMakeLists.txt b/programs/pkey/CMakeLists.txt
index 63d2c5d..136baa3 100644
--- a/programs/pkey/CMakeLists.txt
+++ b/programs/pkey/CMakeLists.txt
@@ -5,7 +5,7 @@
add_dependencies(${programs_target} ${executables_mbedtls})
foreach(exe IN LISTS executables_mbedtls)
- add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
+ add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:tf_psa_crypto_test>)
set_base_compile_options(${exe})
target_link_libraries(${exe} ${mbedtls_target} ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
@@ -34,7 +34,7 @@
add_dependencies(${programs_target} ${executables_mbedcrypto})
foreach(exe IN LISTS executables_mbedcrypto)
- add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
+ add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:tf_psa_crypto_test>)
set_base_compile_options(${exe})
target_link_libraries(${exe} ${tfpsacrypto_target} ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
diff --git a/programs/psa/CMakeLists.txt b/programs/psa/CMakeLists.txt
index b6e2b0d..6cff1cf 100644
--- a/programs/psa/CMakeLists.txt
+++ b/programs/psa/CMakeLists.txt
@@ -28,7 +28,7 @@
endif()
foreach(exe IN LISTS executables)
- add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
+ add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:tf_psa_crypto_test>)
set_base_compile_options(${exe})
target_link_libraries(${exe} ${tfpsacrypto_target} ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
diff --git a/programs/random/CMakeLists.txt b/programs/random/CMakeLists.txt
index 2c3e4d5..37e404e 100644
--- a/programs/random/CMakeLists.txt
+++ b/programs/random/CMakeLists.txt
@@ -5,7 +5,7 @@
add_dependencies(${programs_target} ${executables})
foreach(exe IN LISTS executables)
- add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
+ add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:tf_psa_crypto_test>)
set_base_compile_options(${exe})
target_link_libraries(${exe} ${tfpsacrypto_target} ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
diff --git a/programs/ssl/CMakeLists.txt b/programs/ssl/CMakeLists.txt
index 6919a8e..ed26c6a 100644
--- a/programs/ssl/CMakeLists.txt
+++ b/programs/ssl/CMakeLists.txt
@@ -38,7 +38,7 @@
${CMAKE_CURRENT_SOURCE_DIR}/../test/query_config.h
${CMAKE_CURRENT_BINARY_DIR}/../test/query_config.c)
endif()
- add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>
+ add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:tf_psa_crypto_test>
${extra_sources})
set_base_compile_options(${exe})
target_link_libraries(${exe} ${libs} ${CMAKE_THREAD_LIBS_INIT})
@@ -53,7 +53,7 @@
endforeach()
if(THREADS_FOUND)
- add_executable(ssl_pthread_server ssl_pthread_server.c $<TARGET_OBJECTS:mbedtls_test>)
+ add_executable(ssl_pthread_server ssl_pthread_server.c $<TARGET_OBJECTS:tf_psa_crypto_test>)
set_base_compile_options(ssl_pthread_server)
target_include_directories(ssl_pthread_server PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
target_link_libraries(ssl_pthread_server ${libs} ${CMAKE_THREAD_LIBS_INIT})
diff --git a/programs/test/CMakeLists.txt b/programs/test/CMakeLists.txt
index 5719147..6a90c48 100644
--- a/programs/test/CMakeLists.txt
+++ b/programs/test/CMakeLists.txt
@@ -82,7 +82,7 @@
${CMAKE_CURRENT_SOURCE_DIR}/query_config.h
${CMAKE_CURRENT_BINARY_DIR}/query_config.c)
endif()
- add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>
+ add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:tf_psa_crypto_test>
${extra_sources})
set_base_compile_options(${exe})
target_include_directories(${exe}
diff --git a/programs/util/CMakeLists.txt b/programs/util/CMakeLists.txt
index a535402..befc133 100644
--- a/programs/util/CMakeLists.txt
+++ b/programs/util/CMakeLists.txt
@@ -10,7 +10,7 @@
add_dependencies(${programs_target} ${executables})
foreach(exe IN LISTS executables)
- add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
+ add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:tf_psa_crypto_test>)
set_base_compile_options(${exe})
target_link_libraries(${exe} ${libs} ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
diff --git a/programs/x509/CMakeLists.txt b/programs/x509/CMakeLists.txt
index a31bada..837d97a 100644
--- a/programs/x509/CMakeLists.txt
+++ b/programs/x509/CMakeLists.txt
@@ -13,7 +13,7 @@
add_dependencies(${programs_target} ${executables})
foreach(exe IN LISTS executables)
- add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
+ add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:tf_psa_crypto_test>)
set_base_compile_options(${exe})
target_link_libraries(${exe} ${libs} ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 8318e8b..2deae8f 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -154,7 +154,7 @@
)
add_executable(test_suite_${data_name} test_suite_${data_name}.c
- $<TARGET_OBJECTS:mbedtls_test>
+ $<TARGET_OBJECTS:tf_psa_crypto_test>
$<TARGET_OBJECTS:mbedtls_test_helpers>)
set_base_compile_options(test_suite_${data_name})
target_compile_options(test_suite_${data_name} PRIVATE ${TEST_C_FLAGS})