summaryrefslogtreecommitdiff
path: root/cts/gpio
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2017-04-12 09:48:10 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-06-23 00:51:19 -0700
commitff85876719777d7e375368f73ec0c150a134f291 (patch)
treeac78df3efe0c1d353a95ac0a2c18aca3b08b9168 /cts/gpio
parent60800678ca1a7454a20ae2c270a4ea0bda34b9c0 (diff)
downloadchrome-ec-ff85876719777d7e375368f73ec0c150a134f291.tar.gz
eCTS: Check order and expectation of test results
This patch makes the framework verify not only the result but also the execution order of the tests. It also allows each test to specify expected return code and strings printed by TH and DUT. The final test results depends on the return code and the expectation. Therefore, the output now includes 'RESULT' column showing PASS or FAIL: test name TH_RETURN_CODE DUT_RETURN_CODE TH_STR DUT_STR RESULT test_task_switch SUCCESS SUCCESS 1 1 PASS test_task_priority SUCCESS FAILURE 1 1 FAIL test_stack_overflow DID_NOT_END DID_NOT_END 1 1 PASS Additionally, this patch: * Adds CTS_RC_DID_NOT_START and CTS_RC_DID_NOT_END to indicate whether the test did start or end, respectively. * Makes stack overflow test check whether stack overflow was detected and reboot occurred * Removes post_corruption_test and conflict test since now the test results are stricly compared against expected results. * Fixes gpylint errors. BUG=none BRANCH=none TEST=Run gpio, meta, timer, interrupt, and cts/cts.py -m task Change-Id: I3b7005236e705dcac0c8f4711b44c85ff9a4f676 Reviewed-on: https://chromium-review.googlesource.com/538878 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'cts/gpio')
-rw-r--r--cts/gpio/cts.testlist17
-rw-r--r--cts/gpio/dut.c3
-rw-r--r--cts/gpio/th.c3
3 files changed, 15 insertions, 8 deletions
diff --git a/cts/gpio/cts.testlist b/cts/gpio/cts.testlist
index e59be1c7ce..be303067a3 100644
--- a/cts/gpio/cts.testlist
+++ b/cts/gpio/cts.testlist
@@ -6,15 +6,20 @@
/* Currently tests will execute in the order they are listed here */
/* Test whether sync completes successfully */
-CTS_TEST(sync_test)
+CTS_TEST(sync_test,,,,)
+
/* Check if the dut can set a line low */
-CTS_TEST(set_low_test)
+CTS_TEST(set_low_test,,,,)
+
/* Check if the dut can set a line high */
-CTS_TEST(set_high_test)
+CTS_TEST(set_high_test,,,,)
+
/* Check if the dut can read a line that is low */
-CTS_TEST(read_high_test)
+CTS_TEST(read_high_test,,,,)
+
/* Check if the dut can read a line that is high */
-CTS_TEST(read_low_test)
+CTS_TEST(read_low_test,,,,)
+
/* Check if the dut reads its true pin level (success)
or its register level when configured as a low open drain output pin */
-CTS_TEST(od_read_high_test)
+CTS_TEST(od_read_high_test,,,,)
diff --git a/cts/gpio/dut.c b/cts/gpio/dut.c
index 22694b8c4f..c5b6bf813f 100644
--- a/cts/gpio/dut.c
+++ b/cts/gpio/dut.c
@@ -81,8 +81,9 @@ void cts_task(void)
uart_flush_output();
for (i = 0; i < CTS_TEST_ID_COUNT; i++) {
sync();
+ CPRINTF("\n%s start\n", tests[i].name);
result = tests[i].run();
- CPRINTF("\n%s %d\n", tests[i].name, result);
+ CPRINTF("\n%s end %d\n", tests[i].name, result);
uart_flush_output();
}
diff --git a/cts/gpio/th.c b/cts/gpio/th.c
index 7350ff0e55..d18c1c367a 100644
--- a/cts/gpio/th.c
+++ b/cts/gpio/th.c
@@ -75,8 +75,9 @@ void cts_task(void)
uart_flush_output();
for (i = 0; i < CTS_TEST_ID_COUNT; i++) {
sync();
+ CPRINTF("\n%s start\n", tests[i].name);
result = tests[i].run();
- CPRINTF("\n%s %d\n", tests[i].name, result);
+ CPRINTF("\n%s end %d\n", tests[i].name, result);
uart_flush_output();
}