blob: c891918cb5abe3db218e449c37df746cf55f567f [file] [log] [blame]
julhal013ec4c322021-02-05 17:30:49 +00001/*
2 * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef CPPUTEST_TEST_RUNNER_H
8#define CPPUTEST_TEST_RUNNER_H
9
10#include <protocols/service/test_runner/packed-c/test_result.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16/**
17 * Constants
18 */
19#define TEST_NAME_MAX_LEN (30)
20#define TEST_GROUP_MAX_LEN (30)
21
22/**
23 * Specifies a set of tests for running or listing.
24 */
25struct test_spec
26{
27 char name[TEST_NAME_MAX_LEN];
28 char group[TEST_GROUP_MAX_LEN];
29};
30
31/**
32 * A summary of a set of tests qualified by a test_spec.
33 */
34struct test_summary
35{
36 int num_tests; /* Number of qualifying tests */
37 int num_results; /* Number of available test result objects */
38 int num_passed; /* Number that ran and passed */
39 int num_failed; /* Number that ran and failed */
40};
41
42/**
43 * The run state of a test case
44 */
45enum test_run_state
46{
47 TEST_RUN_STATE_NOT_RUN = TS_TEST_RUNNER_TEST_RESULT_RUN_STATE_NOT_RUN,
48 TEST_RUN_STATE_PASSED = TS_TEST_RUNNER_TEST_RESULT_RUN_STATE_PASSED,
49 TEST_RUN_STATE_FAILED = TS_TEST_RUNNER_TEST_RESULT_RUN_STATE_FAILED
50};
51
52/**
53 * The result for a particular test case.
54 */
55struct test_result
56{
57 char name[TEST_NAME_MAX_LEN];
58 char group[TEST_GROUP_MAX_LEN];
59 enum test_run_state run_state;
60 unsigned int fail_line;
61};
62
63#ifdef __cplusplus
64} /* extern "C" */
65#endif
66
67#endif /* CPPUTEST_TEST_RUNNER_H */