aboutsummaryrefslogtreecommitdiff
path: root/include/test/ut.h
diff options
context:
space:
mode:
authorSimon Glass2022-10-29 19:47:13 -0600
committerSimon Glass2022-11-07 16:24:30 -0700
commitd1b46595700b063faaec3e33f5754642e68b3d8f (patch)
treed63e52f47c82a554fc26f3bcfe5b3d7064532175 /include/test/ut.h
parent6580b618306a24b6ae2974318922c40588ab0284 (diff)
test: Add a way to detect a test that breaks another
When running unit tests, some may have side effects which cause a subsequent test to break. This can sometimes be seen when using 'ut dm' or similar. Add a new argument which allows a particular (failing) test to be run immediately after a certain number of tests have run. This allows the test causing the failure to be determined. Update the documentation also. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/test/ut.h')
-rw-r--r--include/test/ut.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/test/ut.h b/include/test/ut.h
index e0e618b58c2..4d00b4eeca1 100644
--- a/include/test/ut.h
+++ b/include/test/ut.h
@@ -410,10 +410,15 @@ void test_set_state(struct unit_test_state *uts);
* then all tests are run
* @runs_per_test: Number of times to run each test (typically 1)
* @force_run: Run tests that are marked as manual-only (UT_TESTF_MANUAL)
+ * @test_insert: String describing a test to run after n other tests run, in the
+ * format n:name where n is the number of tests to run before this one and
+ * name is the name of the test to run. This is used to find which test causes
+ * another test to fail. If the one test fails, testing stops immediately.
+ * Pass NULL to disable this
* Return: 0 if all tests passed, -1 if any failed
*/
int ut_run_list(const char *name, const char *prefix, struct unit_test *tests,
int count, const char *select_name, int runs_per_test,
- bool force_run);
+ bool force_run, const char *test_insert);
#endif