TF-M Reference Manual
1.2.0
TrustedFirmware-M
Main Page
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
test_framework_integ_test_helper.c
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2017-2019, Arm Limited. All rights reserved.
3
*
4
* SPDX-License-Identifier: BSD-3-Clause
5
*
6
*/
7
8
#include <stdio.h>
9
10
#include "
test_framework.h
"
11
#include "
test_framework_integ_test_helper.h
"
12
13
enum
test_suite_err_t
integ_test
(
const
char
*suite_type,
14
struct
test_suite_t
test_suites[])
15
{
16
uint32_t i;
17
enum
test_suite_err_t
retval =
TEST_SUITE_ERR_NO_ERROR
;
18
19
printf_set_color
(
YELLOW
);
20
TEST_LOG
(
"\r\n#### Execute test suites for the %s area ####\r\n"
,
21
suite_type);
22
23
/* Executes test suites */
24
for
(i = 0; test_suites[i].
freg
!= NULL; i++) {
25
retval =
run_testsuite
(&test_suites[i]);
26
if
(retval !=
TEST_SUITE_ERR_NO_ERROR
) {
27
/* End function execution */
28
return
retval;
29
}
30
}
31
32
/* Prints test suites summary */
33
printf_set_color
(
YELLOW
);
34
TEST_LOG
(
"\r\n*** %s test suites summary ***\r\n"
, suite_type);
35
for
(i = 0; test_suites[i].
freg
!= NULL; i++) {
36
printf_set_color
(
WHITE
);
37
TEST_LOG
(
"Test suite '%s' has "
, test_suites[i].
name
);
38
if
(test_suites[i].val ==
TEST_PASSED
) {
39
printf_set_color
(
GREEN
);
40
TEST_LOG
(
" PASSED\r\n"
);
41
}
else
{
42
printf_set_color
(
RED
);
43
TEST_LOG
(
" FAILED\r\n"
);
44
retval =
TEST_SUITE_ERR_TEST_FAILED
;
45
}
46
}
47
48
printf_set_color
(
YELLOW
);
49
TEST_LOG
(
"\r\n*** End of %s test suites ***\r\n"
, suite_type);
50
return
retval;
51
}
run_testsuite
enum test_suite_err_t run_testsuite(struct test_suite_t *test_suite)
Runs the given test suite.
Definition:
test_framework.c:86
WHITE
Definition:
test_framework_helpers.h:27
TEST_PASSED
Definition:
test_framework.h:23
YELLOW
Definition:
test_framework_helpers.h:23
integ_test
enum test_suite_err_t integ_test(const char *suite_type, struct test_suite_t test_suites[])
Executes integration test suites provided in the parameters.
Definition:
test_framework_integ_test_helper.c:13
test_framework.h
test_t::name
const char * name
Definition:
test_framework.h:45
GREEN
Definition:
test_framework_helpers.h:22
test_suite_t::freg
TESTSUITE_REG *const freg
Definition:
test_framework.h:60
TEST_SUITE_ERR_TEST_FAILED
Definition:
test_framework.h:77
test_suite_t
Definition:
test_framework.h:59
RED
Definition:
test_framework_helpers.h:21
TEST_SUITE_ERR_NO_ERROR
Definition:
test_framework.h:70
TEST_LOG
#define TEST_LOG(...)
Definition:
test_framework.h:139
printf_set_color
void printf_set_color(enum serial_color_t color_id)
Sets the the text color in the serial port.
Definition:
test_framework_helpers.c:37
test_suite_err_t
test_suite_err_t
Definition:
test_framework.h:69
test_framework_integ_test_helper.h
test
framework
test_framework_integ_test_helper.c
Generated on Thu Feb 18 2021 13:29:11 for TF-M Reference Manual by
1.8.6