julhal01 | 3ec4c32 | 2021-02-05 17:30:49 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved. |
| 3 | * SPDX-License-Identifier: BSD-3-Clause |
| 4 | */ |
| 5 | |
| 6 | #ifndef TS_TEST_RUNNER_TEST_RESULT |
| 7 | #define TS_TEST_RUNNER_TEST_RESULT |
| 8 | |
| 9 | #include <stdint.h> |
| 10 | |
| 11 | /** |
| 12 | * Test result summary structure |
| 13 | */ |
| 14 | struct __attribute__ ((__packed__)) ts_test_runner_result_summary |
| 15 | { |
| 16 | uint32_t num_tests; |
| 17 | uint32_t num_passed; |
| 18 | uint32_t num_failed; |
| 19 | }; |
| 20 | |
| 21 | /** |
| 22 | * Variable length parameter tag for a test result object. |
| 23 | * Multiple test results may be returned for a test run. |
| 24 | */ |
| 25 | enum |
| 26 | { |
| 27 | /* A test result record describes the result of a |
| 28 | * particular test. |
| 29 | */ |
| 30 | TS_TEST_RUNNER_TEST_RESULT_TAG = 1 |
| 31 | }; |
| 32 | |
| 33 | /* Test run state values */ |
| 34 | enum |
| 35 | { |
| 36 | TS_TEST_RUNNER_TEST_RESULT_RUN_STATE_NOT_RUN = 1, |
| 37 | TS_TEST_RUNNER_TEST_RESULT_RUN_STATE_PASSED = 2, |
| 38 | TS_TEST_RUNNER_TEST_RESULT_RUN_STATE_FAILED = 3 |
| 39 | }; |
| 40 | |
| 41 | /* Test result fixed sized structure */ |
| 42 | struct __attribute__ ((__packed__)) ts_test_runner_test_result |
| 43 | { |
| 44 | uint32_t run_state; |
julhal01 | 3ec4c32 | 2021-02-05 17:30:49 +0000 | [diff] [blame] | 45 | }; |
| 46 | |
| 47 | /* Variable length output parameter tags */ |
| 48 | enum |
| 49 | { |
| 50 | /* The name of the test */ |
julhal01 | 37e1aea | 2021-02-09 15:22:20 +0000 | [diff] [blame] | 51 | TS_TEST_RUNNER_TEST_RESULT_TAG_NAME = 1, |
julhal01 | 3ec4c32 | 2021-02-05 17:30:49 +0000 | [diff] [blame] | 52 | |
| 53 | /* The group the test belongs to */ |
julhal01 | 37e1aea | 2021-02-09 15:22:20 +0000 | [diff] [blame] | 54 | TS_TEST_RUNNER_TEST_RESULT_TAG_GROUP = 2, |
| 55 | |
| 56 | /* Test failure recorded, optionally included on failure */ |
| 57 | TS_TEST_RUNNER_TEST_RESULT_TAG_FAILURE = 3 |
julhal01 | 3ec4c32 | 2021-02-05 17:30:49 +0000 | [diff] [blame] | 58 | }; |
| 59 | |
julhal01 | 37e1aea | 2021-02-09 15:22:20 +0000 | [diff] [blame] | 60 | /* Test failure fixed sized structure */ |
| 61 | struct __attribute__ ((__packed__)) ts_test_runner_test_failure |
| 62 | { |
| 63 | uint32_t line_num; |
| 64 | uint64_t info; |
| 65 | }; |
| 66 | |
| 67 | |
julhal01 | 3ec4c32 | 2021-02-05 17:30:49 +0000 | [diff] [blame] | 68 | #endif /* TS_TEST_RUNNER_TEST_RESULT */ |