blob: 93cbd54784489ff919c8117ee60933d4defc5831 [file] [log] [blame]
Kevin Peng62a87112020-07-07 15:07:46 +08001/*
Kevin Peng342ec682022-04-29 10:36:58 +08002 * Copyright (c) 2017-2022, Arm Limited. All rights reserved.
Kevin Peng62a87112020-07-07 15:07:46 +08003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
Kevin Peng342ec682022-04-29 10:36:58 +08008#include "test_app.h"
Paul Sokolovsky5d7925e2022-03-15 12:13:53 +03009#include "tfm_log.h"
Kevin Peng62a87112020-07-07 15:07:46 +080010
11#ifdef TEST_FRAMEWORK_NS
Raef Coles5ee45ed2020-09-24 11:25:44 +010012#include "test_framework_integ_test.h"
Kevin Peng62a87112020-07-07 15:07:46 +080013#endif
14
shejia0126b2d782021-08-19 17:08:24 +080015#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 Coles5ee45ed2020-09-24 11:25:44 +010018#include "tfm_secure_client_service_api.h"
Kevin Peng62a87112020-07-07 15:07:46 +080019#endif
20
Kevin Peng342ec682022-04-29 10:36:58 +080021#if PSA_API_TEST_NS
22/**
23 * \brief This symbol is the entry point provided by the PSA API compliance
24 * test libraries
25 */
26extern void val_entry(void);
27#endif
28
Kevin Peng62a87112020-07-07 15:07:46 +080029/**
30 * \brief Services test thread
31 *
32 */
33__attribute__((noreturn))
34void test_app(void *argument)
35{
36 UNUSED_VARIABLE(argument);
37
shejia0126b2d782021-08-19 17:08:24 +080038#if defined(TEST_FRAMEWORK_S) && defined(TFM_LIB_MODEL)
Kevin Peng62a87112020-07-07 15:07:46 +080039 /* 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 Peng342ec682022-04-29 10:36:58 +080046
Kevin Peng62a87112020-07-07 15:07:46 +080047#ifdef TEST_FRAMEWORK_NS
48 tfm_non_secure_client_run_tests();
49#endif
Kevin Peng342ec682022-04-29 10:36:58 +080050
51#ifdef PSA_API_TEST_NS
52 val_entry();
53#endif
54
Paul Sokolovsky5d7925e2022-03-15 12:13:53 +030055 /* Output EOT char for test environments like FVP. */
56 LOG_MSG("\x04");
Kevin Peng342ec682022-04-29 10:36:58 +080057
Kevin Peng62a87112020-07-07 15:07:46 +080058 /* End of test */
59 for (;;) {
60 }
61}