test: Allow running tests multiple times

Some tests can have race conditions which are hard to detect on a single
one. Add a way to run tests more than once, to help with this.

Each individual test is run the requested number of times before moving
to the next test. If any runs failed, a message is shown.

This is most useful when running a single test, since running all tests
multiple times can take a while.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2022-08-01 07:58:45 -06:00
committed by Tom Rini
parent e033c180d0
commit ea94d053e1
7 changed files with 60 additions and 10 deletions

View File

@@ -119,6 +119,30 @@ You can easily use gdb on these tests, without needing --gdbserver::
You can then single-step and look at variables as needed.
Running tests multiple times
----------------------------
Some tests can have race conditions which are hard to detect on a single
one. It is possible to run each individual test multiple times, before moving
to the next test, with the '-r' flag.
This is most useful when running a single test, since running all tests
multiple times can take a while.
For example::
=> ut dm -r1000 dm_test_rtc_set_get
...
Test: dm_test_rtc_set_get: rtc.c (flat tree)
Test: dm_test_rtc_set_get: rtc.c
test/dm/rtc.c:257, dm_test_rtc_reset(): old_base_time == base_time: Expected 0x62e7453c (1659323708), got 0x62e7453d (1659323709)
Test: dm_test_rtc_set_get: rtc.c (flat tree)
Test: dm_test_rtc_set_get: rtc.c
Test: dm_test_rtc_set_get: rtc.c (flat tree)
...
Test dm_test_rtc_reset failed 3 times
Running sandbox_spl tests directly
----------------------------------