tfm: Update TF-M regression tests sample to build NS app
Update the TF-M regression tests sample to build the NS app in the tf-m-tests repository as an external project. The regression tests need to provide test configurations to both TF-M an NS app. Duplicate configuration done in the spe/CMakeLists.txt to configure TF-M image for the regression tests. Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no> Signed-off-by: Markus Swarowsky <markus.swarowsky@nordicsemi.no>
This commit is contained in:
parent
f49cbf13ca
commit
f48467a2a6
2 changed files with 50 additions and 0 deletions
|
@ -40,9 +40,11 @@ if (CONFIG_BUILD_WITH_TFM)
|
||||||
endif()
|
endif()
|
||||||
if (CONFIG_TFM_REGRESSION_S)
|
if (CONFIG_TFM_REGRESSION_S)
|
||||||
list(APPEND TFM_CMAKE_ARGS -DTEST_S=ON)
|
list(APPEND TFM_CMAKE_ARGS -DTEST_S=ON)
|
||||||
|
list(APPEND TFM_CMAKE_ARGS -DTFM_S_REG_TEST:BOOL=ON)
|
||||||
endif()
|
endif()
|
||||||
if (CONFIG_TFM_REGRESSION_NS)
|
if (CONFIG_TFM_REGRESSION_NS)
|
||||||
list(APPEND TFM_CMAKE_ARGS -DTEST_NS=ON)
|
list(APPEND TFM_CMAKE_ARGS -DTEST_NS=ON)
|
||||||
|
list(APPEND TFM_CMAKE_ARGS -DTFM_NS_REG_TEST:BOOL=ON)
|
||||||
endif()
|
endif()
|
||||||
if (CONFIG_TFM_BL2)
|
if (CONFIG_TFM_BL2)
|
||||||
list(APPEND TFM_CMAKE_ARGS -DBL2=TRUE)
|
list(APPEND TFM_CMAKE_ARGS -DBL2=TRUE)
|
||||||
|
|
|
@ -11,3 +11,51 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||||
project(tfm_regression_test)
|
project(tfm_regression_test)
|
||||||
|
|
||||||
target_sources(app PRIVATE src/main.c)
|
target_sources(app PRIVATE src/main.c)
|
||||||
|
|
||||||
|
get_target_property(TFM_BINARY_DIR tfm TFM_BINARY_DIR)
|
||||||
|
get_target_property(TFM_NS_BIN_FILE tfm TFM_NS_BIN_FILE)
|
||||||
|
get_target_property(TFM_NS_HEX_FILE tfm TFM_NS_HEX_FILE)
|
||||||
|
get_target_property(TFM_NS_SIGNED_BIN_FILE tfm TFM_NS_SIGNED_BIN_FILE)
|
||||||
|
|
||||||
|
set(TFM_TEST_REPO_PATH ${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/../tf-m-tests)
|
||||||
|
|
||||||
|
set(TFM_TEST_DIR "${TFM_TEST_REPO_PATH}/tests_reg/test/secure_regression")
|
||||||
|
set(TFM_TEST_CONFIG_FILE "${TFM_TEST_REPO_PATH}/tests_reg/test/config/config.cmake")
|
||||||
|
|
||||||
|
set_property(TARGET zephyr_property_target
|
||||||
|
APPEND PROPERTY TFM_CMAKE_OPTIONS
|
||||||
|
-DCONFIG_TFM_TEST_DIR=${TFM_TEST_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
set_property(TARGET zephyr_property_target
|
||||||
|
APPEND PROPERTY TFM_CMAKE_OPTIONS
|
||||||
|
-DCONFIG_TFM_TEST_CONFIG_FILE=${TFM_TEST_CONFIG_FILE}
|
||||||
|
)
|
||||||
|
|
||||||
|
include(ExternalProject)
|
||||||
|
|
||||||
|
ExternalProject_Add(tfm_regression_test_app
|
||||||
|
SOURCE_DIR ${TFM_TEST_REPO_PATH}/tests_reg
|
||||||
|
BINARY_DIR ${PROJECT_BINARY_DIR}/tfm_ns
|
||||||
|
CONFIGURE_COMMAND
|
||||||
|
${CMAKE_COMMAND}
|
||||||
|
-G ${CMAKE_GENERATOR}
|
||||||
|
-S ${TFM_TEST_REPO_PATH}/tests_reg
|
||||||
|
-B ${PROJECT_BINARY_DIR}/tfm_ns
|
||||||
|
-DCONFIG_SPE_PATH=${TFM_BINARY_DIR}/api_ns
|
||||||
|
-DTFM_TOOLCHAIN_FILE=cmake/toolchain_ns_GNUARM.cmake
|
||||||
|
-DQCBOR_PATH${QCBOR_PATH_TYPE}=${CONFIG_TFM_QCBOR_PATH}
|
||||||
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||||
|
BUILD_COMMAND ${CMAKE_COMMAND} --build .
|
||||||
|
INSTALL_COMMAND ""
|
||||||
|
BUILD_ALWAYS True
|
||||||
|
USES_TERMINAL_BUILD True
|
||||||
|
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tfm_ns
|
||||||
|
DEPENDS tfm
|
||||||
|
BUILD_BYPRODUCTS
|
||||||
|
${TFM_NS_HEX_FILE}
|
||||||
|
${TFM_NS_BIN_FILE}
|
||||||
|
${TFM_NS_SIGNED_BIN_FILE}
|
||||||
|
)
|
||||||
|
|
||||||
|
add_dependencies(app tfm_regression_test_app)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue