blob: 26debd178f7d8d69e259668d680859451f379506 [file] [log] [blame]
David Hucf299b12021-09-12 16:41:48 +08001#-------------------------------------------------------------------------------
Raef Colesc7d80682021-05-26 14:20:31 +01002# Copyright (c) 2021-2022, Arm Limited. All rights reserved.
David Hucf299b12021-09-12 16:41:48 +08003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8# Since the main test directory is a NS dir, this subdir is specifically made a
9# secure directory as it build the secure side tests and services
10if (TFM_MULTI_CORE_TOPOLOGY)
11 include(${CMAKE_SOURCE_DIR}/platform/ext/target/${TFM_PLATFORM}/preload.cmake)
12 tfm_toolchain_reload_compiler()
13endif()
14
Jianliang Shenc168e762022-01-19 11:31:07 +080015# Install directory for non-secure interface API of test services
16# NS can pick up those interface files to build non-secure test cases
17set(TEST_SERVICE_SRC_INSTALL_DIR ${TFM_INSTALL_PATH}/interface/src/test_service)
18set(TEST_SERVICE_INC_INSTALL_DIR ${TFM_INSTALL_PATH}/interface/include/test_service)
19
David Hucf299b12021-09-12 16:41:48 +080020# Test services are also required by some NS regression tests.
21# Include test services at first no matter whether secure tests are enabled.
Jianliang Shenc168e762022-01-19 11:31:07 +080022add_subdirectory(suites/attestation/service)
23add_subdirectory(suites/core/service)
24add_subdirectory(suites/spm/ipc/service)
25add_subdirectory(suites/spm/sfn/service)
26add_subdirectory(suites/ps/service)
27add_subdirectory(suites/irq/service)
28add_subdirectory(suites/fpu/service)
David Hucf299b12021-09-12 16:41:48 +080029
30if (NOT TEST_FRAMEWORK_S)
31 return()
32endif()
33
Jianliang Shenc168e762022-01-19 11:31:07 +080034# secure test services are required if any secure test is opened
35add_subdirectory(common_test_services/tfm_secure_client_service)
36add_subdirectory(common_test_services/tfm_secure_client_2)
37
David Hucf299b12021-09-12 16:41:48 +080038add_library(tfm_test_framework_s INTERFACE)
39add_library(tfm_s_tests INTERFACE)
40
41target_link_libraries(tfm_test_framework_s
42 INTERFACE
43 psa_interface
44 tfm_test_framework_common
45 tfm_sp_log_raw
46)
47
Raef Coles4817eb82022-01-18 12:33:24 +000048target_compile_definitions(tfm_test_framework_s
49 INTERFACE
50 USE_SP_LOG
51)
52
David Hucf299b12021-09-12 16:41:48 +080053target_sources(tfm_s_tests
54 INTERFACE
Raef Colesc7d80682021-05-26 14:20:31 +010055 ${CMAKE_CURRENT_SOURCE_DIR}/secure_suites.c
David Hucf299b12021-09-12 16:41:48 +080056)
57
58target_link_libraries(tfm_s_tests
59 INTERFACE
60 tfm_test_framework_s
61 tfm_partition_defs
62 tfm_spm
63)
64
65target_compile_definitions(tfm_s_tests
66 INTERFACE
67 $<$<BOOL:${PS_TEST_NV_COUNTERS}>:PS_TEST_NV_COUNTERS>
68)
69
70############################# Secure tests #####################################
71
72# Add secure test library targets here to inherit secure side configurations
73if (TEST_S_CRYPTO)
74 add_library(tfm_test_suite_crypto_s STATIC EXCLUDE_FROM_ALL)
75endif()
76if (TEST_S_ATTESTATION)
77 add_library(tfm_test_suite_attestation_s STATIC EXCLUDE_FROM_ALL)
78endif()
79if (TEST_S_ITS)
80 add_library(tfm_test_suite_its_s STATIC EXCLUDE_FROM_ALL)
81endif()
82if (TEST_S_PS)
83 add_library(tfm_test_suite_ps_s STATIC EXCLUDE_FROM_ALL)
84endif()
85if (TEST_S_AUDIT)
86 add_library(tfm_test_suite_audit_s STATIC EXCLUDE_FROM_ALL)
87endif()
88if (TEST_S_PLATFORM)
89 add_library(tfm_test_suite_platform_s STATIC EXCLUDE_FROM_ALL)
90endif()
91if (TEST_S_IPC)
92 add_library(tfm_test_suite_ipc_s STATIC EXCLUDE_FROM_ALL)
93endif()
94if (TEST_S_FWU)
95 add_library(tfm_test_suite_fwu_s STATIC EXCLUDE_FROM_ALL)
96endif()
Feder Liangdb53c6b2021-09-07 15:42:09 +080097if (TEST_S_FPU)
98 add_library(tfm_test_suite_fpu_s STATIC EXCLUDE_FROM_ALL)
99endif()
David Hucf299b12021-09-12 16:41:48 +0800100if (EXTRA_S_TEST_SUITES_PATHS)
101 add_library(tfm_test_suite_extra_s STATIC EXCLUDE_FROM_ALL)
102endif()