Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 1 | /* |
Kevin Peng | 342ec68 | 2022-04-29 10:36:58 +0800 | [diff] [blame^] | 2 | * Copyright (c) 2017-2022, 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 | |
Kevin Peng | 342ec68 | 2022-04-29 10:36:58 +0800 | [diff] [blame^] | 8 | #include "test_app.h" |
Paul Sokolovsky | 5d7925e | 2022-03-15 12:13:53 +0300 | [diff] [blame] | 9 | #include "tfm_log.h" |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 10 | |
| 11 | #ifdef TEST_FRAMEWORK_NS |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 12 | #include "test_framework_integ_test.h" |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 13 | #endif |
| 14 | |
shejia01 | 26b2d78 | 2021-08-19 17:08:24 +0800 | [diff] [blame] | 15 | #if defined(TEST_FRAMEWORK_S) && defined(TFM_LIB_MODEL) |
| 16 | /* Function tfm_secure_client_run_tests() which is declared in |
| 17 | * tfm_secure_client_service_api.h is only required in NS for Library mode. */ |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 18 | #include "tfm_secure_client_service_api.h" |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 19 | #endif |
| 20 | |
Kevin Peng | 342ec68 | 2022-04-29 10:36:58 +0800 | [diff] [blame^] | 21 | #if PSA_API_TEST_NS |
| 22 | /** |
| 23 | * \brief This symbol is the entry point provided by the PSA API compliance |
| 24 | * test libraries |
| 25 | */ |
| 26 | extern void val_entry(void); |
| 27 | #endif |
| 28 | |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 29 | /** |
| 30 | * \brief Services test thread |
| 31 | * |
| 32 | */ |
| 33 | __attribute__((noreturn)) |
| 34 | void test_app(void *argument) |
| 35 | { |
| 36 | UNUSED_VARIABLE(argument); |
| 37 | |
shejia01 | 26b2d78 | 2021-08-19 17:08:24 +0800 | [diff] [blame] | 38 | #if defined(TEST_FRAMEWORK_S) && defined(TFM_LIB_MODEL) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 39 | /* FIXME: The non-secure audit log test currently relies on the fact that |
| 40 | * the audit log secure test is run first. However the Non-secure tests |
| 41 | * represent simpler and more common test cases which would make more sense |
| 42 | * to be run first. Therefore if this dependency is removed the execution |
| 43 | * order of these test classes should be reversed. */ |
| 44 | tfm_secure_client_run_tests(); |
| 45 | #endif |
Kevin Peng | 342ec68 | 2022-04-29 10:36:58 +0800 | [diff] [blame^] | 46 | |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 47 | #ifdef TEST_FRAMEWORK_NS |
| 48 | tfm_non_secure_client_run_tests(); |
| 49 | #endif |
Kevin Peng | 342ec68 | 2022-04-29 10:36:58 +0800 | [diff] [blame^] | 50 | |
| 51 | #ifdef PSA_API_TEST_NS |
| 52 | val_entry(); |
| 53 | #endif |
| 54 | |
Paul Sokolovsky | 5d7925e | 2022-03-15 12:13:53 +0300 | [diff] [blame] | 55 | /* Output EOT char for test environments like FVP. */ |
| 56 | LOG_MSG("\x04"); |
Kevin Peng | 342ec68 | 2022-04-29 10:36:58 +0800 | [diff] [blame^] | 57 | |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 58 | /* End of test */ |
| 59 | for (;;) { |
| 60 | } |
| 61 | } |