summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Bettis <jbettis@google.com>2022-04-06 09:47:54 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-04-07 17:15:37 +0000
commite1d6bc7f84c5a52b555d1c672f8a59489047380e (patch)
tree08a3caac262096642ea9bdbb1df81aacc78e1f5e
parentdee87f10e7f7f6e8fc75d3d248c26ba0dc5de298 (diff)
downloadchrome-ec-e1d6bc7f84c5a52b555d1c672f8a59489047380e.tar.gz
ec: Add sleep to emulated ztests for tasks
Sometimes the tasks don't finish starting until the test is done. There are several tasks that are included in all tests even if they don't use them, such as the console task, and those often don't even start until the end of the test. This causes the number of covered lines in gcov to change from run to run. Add a sleep before printing Pass, as that is when the util/run_host_test kills the test. BRANCH=None BUG=b:213374060 TEST=Ran accel_cal 50 times Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I36a8b2e0812adbbb158c439aea867e1b5bc960d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3573692 Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Aaron Massey <aaronmassey@google.com> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
-rw-r--r--common/test_util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/test_util.c b/common/test_util.c
index 287bcbeddf..37cc42000c 100644
--- a/common/test_util.c
+++ b/common/test_util.c
@@ -225,7 +225,11 @@ void z_ztest_run_test_suite(const char *name, struct unit_test *suite)
suite++;
}
+ /* Sometimes the console task doesn't start until the test is done. */
+ sleep(1);
+
ccprintf("%s: ", name);
+
test_print_result();
}
#endif /* CONFIG_ZEPHYR */