David Hu | cf299b1 | 2021-09-12 16:41:48 +0800 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Raef Coles | c7d8068 | 2021-05-26 14:20:31 +0100 | [diff] [blame] | 2 | # Copyright (c) 2021-2022, Arm Limited. All rights reserved. |
David Hu | cf299b1 | 2021-09-12 16:41:48 +0800 | [diff] [blame] | 3 | # |
| 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 |
| 10 | if (TFM_MULTI_CORE_TOPOLOGY) |
| 11 | include(${CMAKE_SOURCE_DIR}/platform/ext/target/${TFM_PLATFORM}/preload.cmake) |
| 12 | tfm_toolchain_reload_compiler() |
| 13 | endif() |
| 14 | |
Jianliang Shen | c168e76 | 2022-01-19 11:31:07 +0800 | [diff] [blame^] | 15 | # Install directory for non-secure interface API of test services |
| 16 | # NS can pick up those interface files to build non-secure test cases |
| 17 | set(TEST_SERVICE_SRC_INSTALL_DIR ${TFM_INSTALL_PATH}/interface/src/test_service) |
| 18 | set(TEST_SERVICE_INC_INSTALL_DIR ${TFM_INSTALL_PATH}/interface/include/test_service) |
| 19 | |
David Hu | cf299b1 | 2021-09-12 16:41:48 +0800 | [diff] [blame] | 20 | # Test services are also required by some NS regression tests. |
| 21 | # Include test services at first no matter whether secure tests are enabled. |
Jianliang Shen | c168e76 | 2022-01-19 11:31:07 +0800 | [diff] [blame^] | 22 | add_subdirectory(suites/attestation/service) |
| 23 | add_subdirectory(suites/core/service) |
| 24 | add_subdirectory(suites/spm/ipc/service) |
| 25 | add_subdirectory(suites/spm/sfn/service) |
| 26 | add_subdirectory(suites/ps/service) |
| 27 | add_subdirectory(suites/irq/service) |
| 28 | add_subdirectory(suites/fpu/service) |
David Hu | cf299b1 | 2021-09-12 16:41:48 +0800 | [diff] [blame] | 29 | |
| 30 | if (NOT TEST_FRAMEWORK_S) |
| 31 | return() |
| 32 | endif() |
| 33 | |
Jianliang Shen | c168e76 | 2022-01-19 11:31:07 +0800 | [diff] [blame^] | 34 | # secure test services are required if any secure test is opened |
| 35 | add_subdirectory(common_test_services/tfm_secure_client_service) |
| 36 | add_subdirectory(common_test_services/tfm_secure_client_2) |
| 37 | |
David Hu | cf299b1 | 2021-09-12 16:41:48 +0800 | [diff] [blame] | 38 | add_library(tfm_test_framework_s INTERFACE) |
| 39 | add_library(tfm_s_tests INTERFACE) |
| 40 | |
| 41 | target_link_libraries(tfm_test_framework_s |
| 42 | INTERFACE |
| 43 | psa_interface |
| 44 | tfm_test_framework_common |
| 45 | tfm_sp_log_raw |
| 46 | ) |
| 47 | |
| 48 | target_sources(tfm_s_tests |
| 49 | INTERFACE |
Raef Coles | c7d8068 | 2021-05-26 14:20:31 +0100 | [diff] [blame] | 50 | ${CMAKE_CURRENT_SOURCE_DIR}/secure_suites.c |
David Hu | cf299b1 | 2021-09-12 16:41:48 +0800 | [diff] [blame] | 51 | ) |
| 52 | |
| 53 | target_link_libraries(tfm_s_tests |
| 54 | INTERFACE |
| 55 | tfm_test_framework_s |
| 56 | tfm_partition_defs |
| 57 | tfm_spm |
| 58 | ) |
| 59 | |
| 60 | target_compile_definitions(tfm_s_tests |
| 61 | INTERFACE |
| 62 | $<$<BOOL:${PS_TEST_NV_COUNTERS}>:PS_TEST_NV_COUNTERS> |
| 63 | ) |
| 64 | |
| 65 | ############################# Secure tests ##################################### |
| 66 | |
| 67 | # Add secure test library targets here to inherit secure side configurations |
| 68 | if (TEST_S_CRYPTO) |
| 69 | add_library(tfm_test_suite_crypto_s STATIC EXCLUDE_FROM_ALL) |
| 70 | endif() |
| 71 | if (TEST_S_ATTESTATION) |
| 72 | add_library(tfm_test_suite_attestation_s STATIC EXCLUDE_FROM_ALL) |
| 73 | endif() |
| 74 | if (TEST_S_ITS) |
| 75 | add_library(tfm_test_suite_its_s STATIC EXCLUDE_FROM_ALL) |
| 76 | endif() |
| 77 | if (TEST_S_PS) |
| 78 | add_library(tfm_test_suite_ps_s STATIC EXCLUDE_FROM_ALL) |
| 79 | endif() |
| 80 | if (TEST_S_AUDIT) |
| 81 | add_library(tfm_test_suite_audit_s STATIC EXCLUDE_FROM_ALL) |
| 82 | endif() |
| 83 | if (TEST_S_PLATFORM) |
| 84 | add_library(tfm_test_suite_platform_s STATIC EXCLUDE_FROM_ALL) |
| 85 | endif() |
| 86 | if (TEST_S_IPC) |
| 87 | add_library(tfm_test_suite_ipc_s STATIC EXCLUDE_FROM_ALL) |
| 88 | endif() |
| 89 | if (TEST_S_FWU) |
| 90 | add_library(tfm_test_suite_fwu_s STATIC EXCLUDE_FROM_ALL) |
| 91 | endif() |
Feder Liang | db53c6b | 2021-09-07 15:42:09 +0800 | [diff] [blame] | 92 | if (TEST_S_FPU) |
| 93 | add_library(tfm_test_suite_fpu_s STATIC EXCLUDE_FROM_ALL) |
| 94 | endif() |
David Hu | cf299b1 | 2021-09-12 16:41:48 +0800 | [diff] [blame] | 95 | if (EXTRA_S_TEST_SUITES_PATHS) |
| 96 | add_library(tfm_test_suite_extra_s STATIC EXCLUDE_FROM_ALL) |
| 97 | endif() |