summaryrefslogtreecommitdiff
path: root/cts/timer
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/timer
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/timer')
-rw-r--r--cts/timer/cts.testlist2
-rw-r--r--cts/timer/dut.c3
-rw-r--r--cts/timer/th.c3
3 files changed, 5 insertions, 3 deletions
diff --git a/cts/timer/cts.testlist b/cts/timer/cts.testlist
index d4cb3c30b3..9b5da0d6c9 100644
--- a/cts/timer/cts.testlist
+++ b/cts/timer/cts.testlist
@@ -16,4 +16,4 @@
* - GPIO_OUTPUT connection for sending notification from DUT
* - Calibrated TH timer
*/
-CTS_TEST(timer_calibration_test)
+CTS_TEST(timer_calibration_test,,,,)
diff --git a/cts/timer/dut.c b/cts/timer/dut.c
index 29003f36af..4089964791 100644
--- a/cts/timer/dut.c
+++ b/cts/timer/dut.c
@@ -29,8 +29,9 @@ void cts_task(void)
for (i = 0; i < CTS_TEST_ID_COUNT; i++) {
sync();
+ CPRINTF("\n%s start\n", tests[i].name);
rc = tests[i].run();
- CPRINTF("\n%s %d\n", tests[i].name, rc);
+ CPRINTF("\n%s end %d\n", tests[i].name, rc);
cflush();
}
diff --git a/cts/timer/th.c b/cts/timer/th.c
index a6e9d575b1..4c9912fdda 100644
--- a/cts/timer/th.c
+++ b/cts/timer/th.c
@@ -62,8 +62,9 @@ void cts_task(void)
for (i = 0; i < CTS_TEST_ID_COUNT; i++) {
sync();
+ CPRINTF("\n%s start\n", tests[i].name);
rc = tests[i].run();
- CPRINTF("\n%s %d\n", tests[i].name, rc);
+ CPRINTF("\n%s end %d\n", tests[i].name, rc);
cflush();
}