Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 2 | # Copyright (c) 2020, Arm Limited. All rights reserved. |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 8 | cmake_minimum_required(VERSION 3.13) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 9 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 10 | add_library(tfm_ns_tests INTERFACE) |
David Hu | 73f259b | 2020-12-07 10:58:41 +0800 | [diff] [blame^] | 11 | add_library(tfm_test_framework_ns INTERFACE) |
| 12 | add_library(tfm_test_framework_s INTERFACE) |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 13 | |
| 14 | # For multi-core projects, the NS app can be run on a different CPU to the |
| 15 | # Secure code. To facilitate this, we once again reload the compiler to load the |
| 16 | # setting for the NS CPU. Cmake settings are directory scoped so this affects |
| 17 | # anything loaded from or declared in this dir. |
| 18 | if (TFM_MULTI_CORE_TOPOLOGY) |
| 19 | include(${CMAKE_SOURCE_DIR}/platform/ext/target/${TFM_PLATFORM}/preload_ns.cmake) |
Raef Coles | 34cffa7 | 2020-10-28 10:27:19 +0000 | [diff] [blame] | 20 | tfm_toolchain_reload_compiler() |
Kevin Peng | ae997e4 | 2020-07-08 17:06:37 +0800 | [diff] [blame] | 21 | endif() |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 22 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 23 | add_subdirectory(test_services) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 24 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 25 | add_subdirectory(suites/attestation) |
| 26 | add_subdirectory(suites/audit) |
| 27 | add_subdirectory(suites/core) |
| 28 | add_subdirectory(suites/crypto) |
| 29 | add_subdirectory(suites/its) |
| 30 | add_subdirectory(suites/qcbor) |
| 31 | add_subdirectory(suites/ps) |
| 32 | add_subdirectory(suites/t_cose) |
| 33 | add_subdirectory(suites/platform) |
| 34 | if(TFM_PSA_API) |
| 35 | add_subdirectory(suites/ipc) |
| 36 | endif() |
| 37 | if(TFM_MULTI_CORE_TOPOLOGY) |
| 38 | add_subdirectory(suites/multi_core) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 39 | endif() |
| 40 | |
David Hu | 73f259b | 2020-12-07 10:58:41 +0800 | [diff] [blame^] | 41 | add_library(tfm_test_framework_common INTERFACE) |
| 42 | |
| 43 | target_sources(tfm_test_framework_common |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 44 | INTERFACE |
| 45 | ${CMAKE_CURRENT_SOURCE_DIR}/framework/test_framework.c |
| 46 | ${CMAKE_CURRENT_SOURCE_DIR}/framework/test_framework_helpers.c |
| 47 | ${CMAKE_CURRENT_SOURCE_DIR}/framework/test_framework_integ_test_helper.c |
| 48 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 49 | |
David Hu | 73f259b | 2020-12-07 10:58:41 +0800 | [diff] [blame^] | 50 | target_include_directories(tfm_test_framework_common |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 51 | INTERFACE |
| 52 | framework |
| 53 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 54 | |
David Hu | 73f259b | 2020-12-07 10:58:41 +0800 | [diff] [blame^] | 55 | target_link_libraries(tfm_test_framework_ns |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 56 | INTERFACE |
David Hu | 73f259b | 2020-12-07 10:58:41 +0800 | [diff] [blame^] | 57 | tfm_test_framework_common |
| 58 | tfm_ns_interface |
Kevin Peng | af60229 | 2020-10-20 17:49:52 +0800 | [diff] [blame] | 59 | tfm_ns_log |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 60 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 61 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 62 | target_sources(tfm_ns_tests |
| 63 | INTERFACE |
| 64 | ${CMAKE_CURRENT_SOURCE_DIR}/framework/non_secure_suites.c |
| 65 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 66 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 67 | target_link_libraries(tfm_ns_tests |
| 68 | INTERFACE |
David Hu | 73f259b | 2020-12-07 10:58:41 +0800 | [diff] [blame^] | 69 | tfm_test_framework_ns |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 70 | tfm_partition_defs |
| 71 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 72 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 73 | target_compile_definitions(tfm_ns_tests |
| 74 | INTERFACE |
| 75 | $<$<BOOL:${SYMMETRIC_INITIAL_ATTESTATION}>:SYMMETRIC_INITIAL_ATTESTATION> |
Raef Coles | ce57e06 | 2020-10-02 10:39:41 +0100 | [diff] [blame] | 76 | $<$<BOOL:${TFM_INTERACTIVE_TEST}>:CORE_TEST_INTERACTIVE> |
David Hu | 1f098cc | 2020-10-14 15:00:35 +0800 | [diff] [blame] | 77 | $<$<BOOL:${TFM_MULTI_CORE_MULTI_CLIENT_CALL}>:TFM_MULTI_CORE_MULTI_CLIENT_CALL> |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 78 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 79 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 80 | ####################### Secure ################################################# |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 81 | |
David Hu | 73f259b | 2020-12-07 10:58:41 +0800 | [diff] [blame^] | 82 | target_link_libraries(tfm_test_framework_s |
| 83 | INTERFACE |
| 84 | psa_interface |
| 85 | tfm_test_framework_common |
| 86 | tfm_s_log |
| 87 | ) |
| 88 | |
David Hu | 4f538e4 | 2020-11-09 16:46:17 +0800 | [diff] [blame] | 89 | if (TEST_S) |
| 90 | target_sources(tfm_s_tests |
| 91 | INTERFACE |
| 92 | ${CMAKE_CURRENT_SOURCE_DIR}/framework/secure_suites.c |
| 93 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 94 | |
David Hu | 4f538e4 | 2020-11-09 16:46:17 +0800 | [diff] [blame] | 95 | target_link_libraries(tfm_s_tests |
| 96 | INTERFACE |
David Hu | 73f259b | 2020-12-07 10:58:41 +0800 | [diff] [blame^] | 97 | tfm_test_framework_s |
David Hu | 4f538e4 | 2020-11-09 16:46:17 +0800 | [diff] [blame] | 98 | tfm_partition_defs |
| 99 | tfm_spm |
| 100 | ) |
Jamie Fox | 9d68817 | 2020-10-22 23:26:24 +0100 | [diff] [blame] | 101 | |
David Hu | 4f538e4 | 2020-11-09 16:46:17 +0800 | [diff] [blame] | 102 | target_compile_definitions(tfm_s_tests |
| 103 | INTERFACE |
| 104 | $<$<BOOL:${PS_TEST_NV_COUNTERS}>:PS_TEST_NV_COUNTERS> |
| 105 | ) |
| 106 | endif() |