blob: a2a12bd9f656ee514ab7e6fd6f239835c339edde [file] [log] [blame]
Raef Coles19715382020-07-10 09:50:17 +01001#-------------------------------------------------------------------------------
David Hu1a2d4832022-01-18 14:42:04 +08002# Copyright (c) 2020-2022, Arm Limited. All rights reserved.
Chris Brand2e5af6e2022-07-05 11:15:17 -07003# Copyright (c) 2022 Cypress Semiconductor Corporation (an Infineon company)
4# or an affiliate of Cypress Semiconductor Corporation. All rights reserved.
Raef Coles19715382020-07-10 09:50:17 +01005#
6# SPDX-License-Identifier: BSD-3-Clause
7#
8#-------------------------------------------------------------------------------
9
David Hu195cb5a2022-05-10 22:03:26 +080010# If NS app, secure regression test or non-secure regression test is enabled,
11# fetch tf-m-tests repo.
12# The conditiions are actually overlapped but it can make the logic more clear.
13# Besides, the dependencies between NS app and regression tests will be
14# optimized later.
15if (NS OR TFM_S_REG_TEST OR TFM_NS_REG_TEST OR TEST_BL2 OR TEST_BL1_1 OR TEST_BL1_2)
16 # Set tf-m-tests repo config
17 include(${CMAKE_SOURCE_DIR}/lib/ext/tf-m-tests/repo_config_default.cmake)
David Hu3d2121f2021-08-23 18:00:26 +080018
Chris Brand2e5af6e2022-07-05 11:15:17 -070019 fetch_remote_library(
20 LIB_NAME tfm_test_repo
21 LIB_SOURCE_PATH_VAR TFM_TEST_REPO_PATH
22 LIB_BASE_DIR "${CMAKE_BINARY_DIR}/lib/ext"
23 FETCH_CONTENT_ARGS
24 GIT_REPOSITORY https://git.trustedfirmware.org/TF-M/tf-m-tests.git
25 GIT_TAG ${TFM_TEST_REPO_VERSION}
David Hu195cb5a2022-05-10 22:03:26 +080026 GIT_PROGRESS TRUE
Chris Brand2e5af6e2022-07-05 11:15:17 -070027 )
Raef Coles19715382020-07-10 09:50:17 +010028
David Hu195cb5a2022-05-10 22:03:26 +080029 if ("${CMSIS_5_PATH}" STREQUAL DOWNLOAD)
30 set(CMSIS_5_PATH ${TFM_TEST_REPO_PATH}/CMSIS CACHE PATH "Path to CMSIS_5 (or DOWNLOAD to fetch automatically" FORCE)
31 endif()
Raef Coles19715382020-07-10 09:50:17 +010032
David Hu195cb5a2022-05-10 22:03:26 +080033 if (NOT TFM_TEST_PATH)
34 set(TFM_TEST_PATH ${TFM_TEST_REPO_PATH}/test CACHE PATH "Path to TFM tests" FORCE)
35 endif()
36
37 # Load TF-M regression test suites setting
38 if (TFM_NS_REG_TEST OR TFM_S_REG_TEST)
39 include(${TFM_TEST_PATH}/config/set_config.cmake)
40 endif()
Raef Coles19715382020-07-10 09:50:17 +010041endif()