blob: 87a5d4262cc5b949ff0a8f16e11092f039e674d7 [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
15# Test services are also required by some NS regression tests.
16# Include test services at first no matter whether secure tests are enabled.
17add_subdirectory(test_services)
18
19if (NOT TEST_FRAMEWORK_S)
20 return()
21endif()
22
23add_library(tfm_test_framework_s INTERFACE)
24add_library(tfm_s_tests INTERFACE)
25
26target_link_libraries(tfm_test_framework_s
27 INTERFACE
28 psa_interface
29 tfm_test_framework_common
30 tfm_sp_log_raw
31)
32
33target_sources(tfm_s_tests
34 INTERFACE
Raef Colesc7d80682021-05-26 14:20:31 +010035 ${CMAKE_CURRENT_SOURCE_DIR}/secure_suites.c
David Hucf299b12021-09-12 16:41:48 +080036)
37
38target_link_libraries(tfm_s_tests
39 INTERFACE
40 tfm_test_framework_s
41 tfm_partition_defs
42 tfm_spm
43)
44
45target_compile_definitions(tfm_s_tests
46 INTERFACE
47 $<$<BOOL:${PS_TEST_NV_COUNTERS}>:PS_TEST_NV_COUNTERS>
48)
49
50############################# Secure tests #####################################
51
52# Add secure test library targets here to inherit secure side configurations
53if (TEST_S_CRYPTO)
54 add_library(tfm_test_suite_crypto_s STATIC EXCLUDE_FROM_ALL)
55endif()
56if (TEST_S_ATTESTATION)
57 add_library(tfm_test_suite_attestation_s STATIC EXCLUDE_FROM_ALL)
58endif()
59if (TEST_S_ITS)
60 add_library(tfm_test_suite_its_s STATIC EXCLUDE_FROM_ALL)
61endif()
62if (TEST_S_PS)
63 add_library(tfm_test_suite_ps_s STATIC EXCLUDE_FROM_ALL)
64endif()
65if (TEST_S_AUDIT)
66 add_library(tfm_test_suite_audit_s STATIC EXCLUDE_FROM_ALL)
67endif()
68if (TEST_S_PLATFORM)
69 add_library(tfm_test_suite_platform_s STATIC EXCLUDE_FROM_ALL)
70endif()
71if (TEST_S_IPC)
72 add_library(tfm_test_suite_ipc_s STATIC EXCLUDE_FROM_ALL)
73endif()
74if (TEST_S_FWU)
75 add_library(tfm_test_suite_fwu_s STATIC EXCLUDE_FROM_ALL)
76endif()
Feder Liangdb53c6b2021-09-07 15:42:09 +080077if (TEST_S_FPU)
78 add_library(tfm_test_suite_fpu_s STATIC EXCLUDE_FROM_ALL)
79endif()
David Hucf299b12021-09-12 16:41:48 +080080if (EXTRA_S_TEST_SUITES_PATHS)
81 add_library(tfm_test_suite_extra_s STATIC EXCLUDE_FROM_ALL)
82endif()