summaryrefslogtreecommitdiff
path: root/cts/common/cts_testlist.h
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2017-06-22 14:36:24 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-06-27 15:52:06 -0700
commita82421df00ac1834d0dc8a93f788c323b1bf1977 (patch)
tree3ce0268be0e05e9b53a6afe5565bbf3cf6e8a06d /cts/common/cts_testlist.h
parent4c23fa01df623438e7d2bfe51dec6eac4f7d9ff2 (diff)
downloadchrome-ec-a82421df00ac1834d0dc8a93f788c323b1bf1977.tar.gz
eCTS: Print start marker before sync
This patch makes each test print start marker before sync. This will allow us to distinguish the failure before even sync is attempted (CTS_RC_DID_NOT_START, thus probably caused by the previous test) and the failure caused by the hanging partner, in which case the one good and alive will be stuck in sync (and should return _DID_NOT_END or even better _BAD_SYNC once we implement timeout in sync). This patch also: * Adds did_not_start_test to and removes debug_test from meta suite * Consolidates test runner loops into common cts_main_loop * Removes dut_common.h and th_common.h * Removes debug print macro and CTS_DEBUG * Replaces all infinite loops after tests with task_wait_event(-1) * Removes meaningless comments and debug printfs * Removes CTS_TEST_ID_* * Adds sync() to task suite BUG=chromium:736104 BRANCH=none TEST=Run run_ects.sh and verify all tests pass Change-Id: I6ccdf26afac6b8e8cb16483c5d75e4e77e7962f4 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/545176
Diffstat (limited to 'cts/common/cts_testlist.h')
-rw-r--r--cts/common/cts_testlist.h30
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);