Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2017, 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 "integ_test_helper.h" |
| 12 | |
| 13 | void integ_test(const char *suite_type, |
| 14 | struct test_suite_t test_suites[], |
| 15 | uint32_t test_suite_cnt) |
| 16 | { |
| 17 | uint32_t i; |
| 18 | |
| 19 | printf_set_color(YELLOW); |
| 20 | printf("\r\n#### Execute test suites for the %s area ####\r\n", suite_type); |
| 21 | |
| 22 | /* Executes test suites */ |
| 23 | for (i = 0; i < test_suite_cnt; i++) { |
| 24 | if (run_testsuite(&test_suites[i]) != TEST_SUITE_ERR_NO_ERROR) { |
| 25 | /* End function execution */ |
| 26 | return; |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | /* Prints test suites summary */ |
| 31 | printf_set_color(YELLOW); |
| 32 | printf("\r\n*** %s test suites summary ***\r\n", suite_type); |
| 33 | for (i = 0; i < test_suite_cnt; i++) { |
| 34 | printf_set_color(WHITE); |
| 35 | printf("Test suite '%s' has ", test_suites[i].name); |
| 36 | if (test_suites[i].val == TEST_PASSED) { |
| 37 | printf_set_color(GREEN); |
| 38 | printf(" PASSED"); |
| 39 | } else { |
| 40 | printf_set_color(RED); |
| 41 | printf(" FAILED"); |
| 42 | } |
| 43 | printf("\r\n"); |
| 44 | } |
| 45 | |
| 46 | printf_set_color(YELLOW); |
| 47 | printf("\r\n*** End of %s test suites ***\r\n", suite_type); |
| 48 | } |