David Hu | 6318d21 | 2021-08-23 18:07:57 +0800 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Feder Liang | 7abe9a4 | 2021-12-03 17:54:58 +0800 | [diff] [blame] | 2 | # Copyright (c) 2021-2022, Arm Limited. All rights reserved. |
David Hu | 6318d21 | 2021-08-23 18:07:57 +0800 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
| 8 | ########################## TEST SYNC ########################################### |
| 9 | |
Mark Horvath | 2f07258 | 2022-09-09 16:15:30 +0200 | [diff] [blame] | 10 | if ((NOT TFM_PARTITION_PROTECTED_STORAGE)) |
David Hu | 6318d21 | 2021-08-23 18:07:57 +0800 | [diff] [blame] | 11 | set(TEST_NS_PS OFF CACHE BOOL "Whether to build NS regression PS tests") |
| 12 | set(TEST_S_PS OFF CACHE BOOL "Whether to build S regression PS tests") |
| 13 | endif() |
| 14 | |
Mark Horvath | 2f07258 | 2022-09-09 16:15:30 +0200 | [diff] [blame] | 15 | if (NOT TFM_PARTITION_INTERNAL_TRUSTED_STORAGE) |
David Hu | 6318d21 | 2021-08-23 18:07:57 +0800 | [diff] [blame] | 16 | set(TEST_NS_ITS OFF CACHE BOOL "Whether to build NS regression ITS tests") |
| 17 | set(TEST_S_ITS OFF CACHE BOOL "Whether to build S regression ITS tests") |
| 18 | |
| 19 | # TEST_NS_PS relies on TEST_NS_ITS |
| 20 | set(TEST_NS_PS OFF CACHE BOOL "Whether to build NS regression PS tests") |
| 21 | endif() |
| 22 | |
Mark Horvath | 2f07258 | 2022-09-09 16:15:30 +0200 | [diff] [blame] | 23 | if (NOT TFM_PARTITION_CRYPTO) |
David Hu | 6318d21 | 2021-08-23 18:07:57 +0800 | [diff] [blame] | 24 | set(TEST_NS_CRYPTO OFF CACHE BOOL "Whether to build NS regression Crypto tests") |
| 25 | set(TEST_S_CRYPTO OFF CACHE BOOL "Whether to build S regression Crypto tests") |
| 26 | endif() |
| 27 | |
Mark Horvath | 2f07258 | 2022-09-09 16:15:30 +0200 | [diff] [blame] | 28 | if (NOT TFM_PARTITION_INITIAL_ATTESTATION) |
David Hu | 6318d21 | 2021-08-23 18:07:57 +0800 | [diff] [blame] | 29 | set(TEST_NS_ATTESTATION OFF CACHE BOOL "Whether to build NS regression Attestation tests") |
| 30 | set(TEST_S_ATTESTATION OFF CACHE BOOL "Whether to build S regression Attestation tests") |
| 31 | set(TEST_NS_QCBOR OFF CACHE BOOL "Whether to build NS regression QCBOR tests") |
| 32 | set(TEST_NS_T_COSE OFF CACHE BOOL "Whether to build NS regression t_cose tests") |
| 33 | endif() |
| 34 | |
| 35 | if (SYMMETRIC_INITIAL_ATTESTATION) |
| 36 | set(TEST_NS_T_COSE OFF CACHE BOOL "Whether to build NS regression t_cose tests") |
| 37 | endif() |
| 38 | |
Mark Horvath | 2f07258 | 2022-09-09 16:15:30 +0200 | [diff] [blame] | 39 | if (NOT TFM_PARTITION_PLATFORM) |
David Hu | 6318d21 | 2021-08-23 18:07:57 +0800 | [diff] [blame] | 40 | set(TEST_NS_PLATFORM OFF CACHE BOOL "Whether to build NS regression Platform tests") |
| 41 | set(TEST_S_PLATFORM OFF CACHE BOOL "Whether to build S regression Platform tests") |
| 42 | endif() |
| 43 | |
| 44 | if (NOT TFM_PARTITION_FIRMWARE_UPDATE) |
| 45 | set(TEST_NS_FWU OFF CACHE BOOL "Whether to build NS regression FWU tests") |
| 46 | set(TEST_S_FWU OFF CACHE BOOL "Whether to build S regression FWU tests") |
| 47 | endif() |
| 48 | |
David Hu | 6318d21 | 2021-08-23 18:07:57 +0800 | [diff] [blame] | 49 | if (NOT TFM_MULTI_CORE_TOPOLOGY) |
| 50 | set(TEST_NS_MULTI_CORE OFF CACHE BOOL "Whether to build NS regression multi-core tests") |
| 51 | endif() |
| 52 | |
Xinyu Zhang | 92fe758 | 2021-09-24 17:11:49 +0800 | [diff] [blame] | 53 | if (NOT TFM_NS_MANAGE_NSID) |
| 54 | set(TEST_NS_MANAGE_NSID OFF CACHE BOOL "Whether to build NS regression NSID management tests") |
| 55 | endif() |
| 56 | |
Gabor Toth | 608e92f | 2022-09-06 12:41:41 +0200 | [diff] [blame] | 57 | if (CONFIG_TFM_FLOAT_ABI STREQUAL "soft") |
Feder Liang | 7abe9a4 | 2021-12-03 17:54:58 +0800 | [diff] [blame] | 58 | set(TEST_S_FPU OFF CACHE BOOL "Whether to build S regression FPU tests") |
| 59 | set(TEST_NS_FPU OFF CACHE BOOL "Whether to build NS regression FPU tests") |
Feder Liang | db53c6b | 2021-09-07 15:42:09 +0800 | [diff] [blame] | 60 | endif() |
| 61 | |
David Hu | 6318d21 | 2021-08-23 18:07:57 +0800 | [diff] [blame] | 62 | ########################## Test framework sync ################################# |
| 63 | |
| 64 | get_cmake_property(CACHE_VARS CACHE_VARIABLES) |
David Hu | cf299b1 | 2021-09-12 16:41:48 +0800 | [diff] [blame] | 65 | |
| 66 | if (NS) |
| 67 | # Force TEST_FRAMEWORK_NS ON if single NS test ON |
| 68 | foreach(CACHE_VAR ${CACHE_VARS}) |
| 69 | string(REGEX MATCH "^TEST_NS_.*" _NS_TEST_FOUND "${CACHE_VAR}") |
| 70 | if (_NS_TEST_FOUND AND "${${CACHE_VAR}}") |
| 71 | set(TEST_FRAMEWORK_NS ON CACHE BOOL "Whether to build NS regression tests framework") |
| 72 | break() |
| 73 | endif() |
| 74 | endforeach() |
| 75 | endif() |
David Hu | 6318d21 | 2021-08-23 18:07:57 +0800 | [diff] [blame] | 76 | |
| 77 | # Force TEST_FRAMEWORK_S ON if single S test ON |
| 78 | foreach(CACHE_VAR ${CACHE_VARS}) |
| 79 | string(REGEX MATCH "^TEST_S_.*" _S_TEST_FOUND "${CACHE_VAR}") |
| 80 | if (_S_TEST_FOUND AND "${${CACHE_VAR}}") |
| 81 | set(TEST_FRAMEWORK_S ON CACHE BOOL "Whether to build S regression tests framework") |
| 82 | break() |
| 83 | endif() |
| 84 | endforeach() |
| 85 | |
Jianliang Shen | 2959c1f | 2021-09-01 10:14:06 +0800 | [diff] [blame] | 86 | ########################## Extra test suites ################################### |
| 87 | |
| 88 | if (EXTRA_NS_TEST_SUITES_PATHS) |
| 89 | set(TEST_FRAMEWORK_NS ON CACHE BOOL "Whether to build NS regression tests framework") |
| 90 | endif() |
| 91 | |
| 92 | if (EXTRA_S_TEST_SUITES_PATHS) |
| 93 | set(TEST_FRAMEWORK_S ON CACHE BOOL "Whether to build S regression tests framework") |
| 94 | endif() |
| 95 | |
shejia01 | 2feb8e9 | 2021-06-30 19:41:26 +0800 | [diff] [blame] | 96 | ########################## Test profile ######################################## |
| 97 | |
| 98 | if (TFM_PROFILE) |
| 99 | include(${TFM_TEST_PATH}/config/profile/${TFM_PROFILE}_test.cmake) |
| 100 | endif() |
| 101 | |
David Hu | d1cba50 | 2021-11-23 14:55:15 +0800 | [diff] [blame] | 102 | ########################## SLIH/FLIH IRQ Test ################################## |
| 103 | |
| 104 | # Make FLIH IRQ test as the default IRQ test |
Summer Qin | d13f55b | 2022-10-09 11:29:57 +0800 | [diff] [blame] | 105 | if (PLATFORM_FLIH_IRQ_TEST_SUPPORT |
David Hu | d1cba50 | 2021-11-23 14:55:15 +0800 | [diff] [blame] | 106 | AND TEST_NS AND NOT TEST_NS_SLIH_IRQ) |
| 107 | set(TEST_NS_FLIH_IRQ ON CACHE BOOL "Whether to build NS regression First-Level Interrupt Handling tests") |
| 108 | endif() |
| 109 | |
Summer Qin | d13f55b | 2022-10-09 11:29:57 +0800 | [diff] [blame] | 110 | if (PLATFORM_SLIH_IRQ_TEST_SUPPORT |
David Hu | d1cba50 | 2021-11-23 14:55:15 +0800 | [diff] [blame] | 111 | AND TEST_NS AND NOT TEST_NS_FLIH_IRQ) |
| 112 | set(TEST_NS_SLIH_IRQ ON CACHE BOOL "Whether to build NS regression Second-Level Interrupt Handling tests") |
| 113 | endif() |
| 114 | |
Kevin Peng | f828d5a | 2022-03-09 15:35:12 +0800 | [diff] [blame] | 115 | ############################ IPC backend test ################################## |
| 116 | if (CONFIG_TFM_SPM_BACKEND_IPC AND TEST_NS) |
| 117 | set(TEST_NS_IPC ON CACHE BOOL "Whether to build NS regression SFN backend tests") |
| 118 | endif() |
| 119 | |
| 120 | if (CONFIG_TFM_SPM_BACKEND_IPC AND TEST_S) |
| 121 | set(TEST_S_IPC ON CACHE BOOL "Whether to build NS regression SFN backend tests") |
| 122 | endif() |
| 123 | |
David Hu | 0a880d3 | 2022-02-23 17:08:12 +0800 | [diff] [blame] | 124 | ############################ SFN backend test ################################## |
| 125 | |
| 126 | if (CONFIG_TFM_SPM_BACKEND_SFN AND TEST_NS) |
| 127 | set(TEST_NS_SFN_BACKEND ON CACHE BOOL "Whether to build NS regression SFN backend tests") |
| 128 | endif() |
| 129 | |
Kevin Peng | e85c6a8 | 2022-03-03 17:12:27 +0800 | [diff] [blame] | 130 | if (CONFIG_TFM_SPM_BACKEND_SFN AND TEST_S) |
| 131 | set(TEST_S_SFN_BACKEND ON CACHE BOOL "Whether to build S regression SFN backend tests") |
| 132 | endif() |
| 133 | |
David Hu | 6318d21 | 2021-08-23 18:07:57 +0800 | [diff] [blame] | 134 | ########################## Load default config ################################# |
| 135 | |
| 136 | if (TEST_S) |
| 137 | include(${TFM_TEST_PATH}/config/default_s_test_config.cmake) |
| 138 | endif() |
| 139 | if (TEST_NS) |
David Hu | cf299b1 | 2021-09-12 16:41:48 +0800 | [diff] [blame] | 140 | if (NOT NS) |
| 141 | # In this case, TEST_NS is used to configure corresponding test secure |
| 142 | # services during SPE build alone. |
| 143 | # Disable TEST_FRAMEWORK_NS if NS is OFF as NS test framework shall |
| 144 | # run inside NS environment |
| 145 | set(TEST_FRAMEWORK_NS OFF CACHE BOOL "Whether to build NS regression tests framework") |
| 146 | endif() |
David Hu | 6318d21 | 2021-08-23 18:07:57 +0800 | [diff] [blame] | 147 | include(${TFM_TEST_PATH}/config/default_ns_test_config.cmake) |
| 148 | endif() |
| 149 | |
Kevin Peng | ac81587 | 2021-10-25 17:59:59 +0800 | [diff] [blame] | 150 | ###################### Test Partition configurations ########################### |
| 151 | if (TEST_NS_IPC OR TEST_S_IPC) |
| 152 | set(TFM_PARTITION_IPC_TEST ON) |
| 153 | else() |
| 154 | set(TFM_PARTITION_IPC_TEST OFF) |
| 155 | endif() |
| 156 | |
Kevin Peng | e85c6a8 | 2022-03-03 17:12:27 +0800 | [diff] [blame] | 157 | if (TEST_NS_SFN_BACKEND OR TEST_S_SFN_BACKEND) |
| 158 | set(TFM_PARTITION_SFN_BACKEND_TEST ON) |
| 159 | else() |
| 160 | set(TFM_PARTITION_SFN_BACKEND_TEST OFF) |
| 161 | endif() |
| 162 | |
Feder Liang | 7abe9a4 | 2021-12-03 17:54:58 +0800 | [diff] [blame] | 163 | # Enable FPU test partition if S or NS FP test enabled |
| 164 | if (TEST_S_FPU OR TEST_NS_FPU) |
| 165 | set(TEST_PARTITION_FPU_TEST ON) |
| 166 | else() |
| 167 | set(TEST_PARTITION_FPU_TEST OFF) |
| 168 | endif() |
| 169 | |
David Hu | 6318d21 | 2021-08-23 18:07:57 +0800 | [diff] [blame] | 170 | include(${TFM_TEST_PATH}/config/default_test_config.cmake) |