TF-M Reference Manual  1.2.0
TrustedFirmware-M
 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"
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;
18 
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 */
34  TEST_LOG("\r\n*** %s test suites summary ***\r\n", suite_type);
35  for (i = 0; test_suites[i].freg != NULL; i++) {
37  TEST_LOG("Test suite '%s' has ", test_suites[i].name);
38  if (test_suites[i].val == TEST_PASSED) {
40  TEST_LOG(" PASSED\r\n");
41  } else {
43  TEST_LOG(" FAILED\r\n");
45  }
46  }
47 
49  TEST_LOG("\r\n*** End of %s test suites ***\r\n", suite_type);
50  return retval;
51 }
enum test_suite_err_t run_testsuite(struct test_suite_t *test_suite)
Runs the given test suite.
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.
const char * name
TESTSUITE_REG *const freg
#define TEST_LOG(...)
void printf_set_color(enum serial_color_t color_id)
Sets the the text color in the serial port.
test_suite_err_t