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) |
| 11 | add_library(tfm_test_framework INTERFACE) |
| 12 | |
| 13 | # For multi-core projects, the NS app can be run on a different CPU to the |
| 14 | # Secure code. To facilitate this, we once again reload the compiler to load the |
| 15 | # setting for the NS CPU. Cmake settings are directory scoped so this affects |
| 16 | # anything loaded from or declared in this dir. |
| 17 | if (TFM_MULTI_CORE_TOPOLOGY) |
| 18 | include(${CMAKE_SOURCE_DIR}/platform/ext/target/${TFM_PLATFORM}/preload_ns.cmake) |
Kevin Peng | ae997e4 | 2020-07-08 17:06:37 +0800 | [diff] [blame] | 19 | endif() |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 20 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 21 | add_subdirectory(test_services) |
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(suites/attestation) |
| 24 | add_subdirectory(suites/audit) |
| 25 | add_subdirectory(suites/core) |
| 26 | add_subdirectory(suites/crypto) |
| 27 | add_subdirectory(suites/its) |
| 28 | add_subdirectory(suites/qcbor) |
| 29 | add_subdirectory(suites/ps) |
| 30 | add_subdirectory(suites/t_cose) |
| 31 | add_subdirectory(suites/platform) |
| 32 | if(TFM_PSA_API) |
| 33 | add_subdirectory(suites/ipc) |
| 34 | endif() |
| 35 | if(TFM_MULTI_CORE_TOPOLOGY) |
| 36 | add_subdirectory(suites/multi_core) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 37 | endif() |
| 38 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 39 | target_sources(tfm_test_framework |
| 40 | INTERFACE |
| 41 | ${CMAKE_CURRENT_SOURCE_DIR}/framework/test_framework.c |
| 42 | ${CMAKE_CURRENT_SOURCE_DIR}/framework/test_framework_helpers.c |
| 43 | ${CMAKE_CURRENT_SOURCE_DIR}/framework/test_framework_integ_test_helper.c |
| 44 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 45 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 46 | target_include_directories(tfm_test_framework |
| 47 | INTERFACE |
| 48 | framework |
| 49 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 50 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 51 | target_link_libraries(tfm_test_framework |
| 52 | INTERFACE |
| 53 | psa_interface |
| 54 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 55 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 56 | target_sources(tfm_ns_tests |
| 57 | INTERFACE |
| 58 | ${CMAKE_CURRENT_SOURCE_DIR}/framework/non_secure_suites.c |
| 59 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 60 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 61 | target_link_libraries(tfm_ns_tests |
| 62 | INTERFACE |
| 63 | tfm_test_framework |
| 64 | tfm_partition_defs |
| 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_compile_definitions(tfm_ns_tests |
| 68 | INTERFACE |
| 69 | $<$<BOOL:${SYMMETRIC_INITIAL_ATTESTATION}>:SYMMETRIC_INITIAL_ATTESTATION> |
Raef Coles | ce57e06 | 2020-10-02 10:39:41 +0100 | [diff] [blame] | 70 | $<$<BOOL:${TFM_INTERACTIVE_TEST}>:CORE_TEST_INTERACTIVE> |
David Hu | 1f098cc | 2020-10-14 15:00:35 +0800 | [diff] [blame^] | 71 | $<$<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] | 72 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 73 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 74 | ####################### Secure ################################################# |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 75 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 76 | target_sources(tfm_s_tests |
| 77 | INTERFACE |
| 78 | ${CMAKE_CURRENT_SOURCE_DIR}/framework/secure_suites.c |
| 79 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 80 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 81 | target_link_libraries(tfm_s_tests |
| 82 | INTERFACE |
| 83 | tfm_test_framework |
| 84 | tfm_partition_defs |
| 85 | tfm_spm |
| 86 | ) |