ztest: add a delay between tests through CONFIG_ZTEST_TEST_DELAY_MS
Some testsuites dump lots of output very fast where some systems are not able to capture the complete output from the tests. Add a slight delay between each test in the suite. New kconfig CONFIG_ZTEST_TEST_DELAY_MS is added to ztest. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
1b98db232e
commit
268fff57a8
2 changed files with 10 additions and 0 deletions
|
@ -22,6 +22,13 @@ config ZTEST_STACK_SIZE
|
||||||
default 2048 if COVERAGE_GCOV
|
default 2048 if COVERAGE_GCOV
|
||||||
default 1024
|
default 1024
|
||||||
|
|
||||||
|
config ZTEST_TEST_DELAY_MS
|
||||||
|
int "Delay between tests in milliseconds"
|
||||||
|
default 0
|
||||||
|
help
|
||||||
|
Add a delay between between tests to manage output on the console on
|
||||||
|
systems that can't handle the rapid output rate.
|
||||||
|
|
||||||
config ZTEST_FAIL_FAST
|
config ZTEST_FAIL_FAST
|
||||||
bool "Abort on first failing test"
|
bool "Abort on first failing test"
|
||||||
help
|
help
|
||||||
|
|
|
@ -509,6 +509,9 @@ static int run_test(struct ztest_suite_node *suite, struct ztest_unit_test *test
|
||||||
{
|
{
|
||||||
int ret = TC_PASS;
|
int ret = TC_PASS;
|
||||||
|
|
||||||
|
#if CONFIG_ZTEST_TEST_DELAY_MS > 0
|
||||||
|
k_busy_wait(CONFIG_ZTEST_TEST_DELAY_MS * USEC_PER_MSEC);
|
||||||
|
#endif
|
||||||
TC_START(test->name);
|
TC_START(test->name);
|
||||||
|
|
||||||
phase = TEST_PHASE_BEFORE;
|
phase = TEST_PHASE_BEFORE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue