diff options
Diffstat (limited to 'cts/common/cts_testlist.h')
-rw-r--r-- | cts/common/cts_testlist.h | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/cts/common/cts_testlist.h b/cts/common/cts_testlist.h index 9e18c7f8eb..1586c1348e 100644 --- a/cts/common/cts_testlist.h +++ b/cts/common/cts_testlist.h @@ -3,26 +3,28 @@ * found in the LICENSE file. */ +#include "util.h" + /* - * CTS_TEST macro is used by dut.c, th.c, and cts.py. Currently, the 2nd - * and 3rd arguments are only used by cts.py. They specify the expected - * strings output by TH and DUT, respectively. + * CTS_TEST macro takes the following arguments: + * + * @test: Function running the test + * @th_rc: Expected CTS_RC_* from TH + * @th_string: Expected string printed by TH + * @dut_rc: Expected CTR_RC_* from DUT + * @dut_string: Expected string printed by DUT + * + * CTS_TEST macro is processed in multiple places. One is here for creating + * an array of test functions. Only @test is used. + * + * Another is in cts.py for evaluating the test results against expectations. */ -struct cts_test { - enum cts_rc (*run)(void); - char *name; -}; - +#undef CTS_TEST #define CTS_TEST(test, th_rc, th_string, dut_rc, dut_string) \ {test, STRINGIFY(test)}, struct cts_test tests[] = { #include "cts.testlist" }; -#undef CTS_TEST -#define CTS_TEST(test, th_rc, th_string, dut_rc, dut_string) CTS_TEST_ID_##test, -enum { -#include "cts.testlist" - CTS_TEST_ID_COUNT, -}; +const int cts_test_count = ARRAY_SIZE(tests); |