summaryrefslogtreecommitdiff
path: root/test/cmd_ut.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-10-29 19:47:13 -0600
committerSimon Glass <sjg@chromium.org>2022-11-07 16:24:30 -0700
commitd1b46595700b063faaec3e33f5754642e68b3d8f (patch)
treed63e52f47c82a554fc26f3bcfe5b3d7064532175 /test/cmd_ut.c
parent6580b618306a24b6ae2974318922c40588ab0284 (diff)
downloadu-boot-d1b46595700b063faaec3e33f5754642e68b3d8f.tar.gz
u-boot-d1b46595700b063faaec3e33f5754642e68b3d8f.tar.bz2
u-boot-d1b46595700b063faaec3e33f5754642e68b3d8f.zip
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 'test/cmd_ut.c')
-rw-r--r--test/cmd_ut.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/cmd_ut.c b/test/cmd_ut.c
index 76e37f35c8..2736582f11 100644
--- a/test/cmd_ut.c
+++ b/test/cmd_ut.c
@@ -21,6 +21,7 @@ int cmd_ut_category(const char *name, const char *prefix,
struct unit_test *tests, int n_ents,
int argc, char *const argv[])
{
+ const char *test_insert = NULL;
int runs_per_text = 1;
bool force_run = false;
int ret;
@@ -35,13 +36,17 @@ int cmd_ut_category(const char *name, const char *prefix,
case 'f':
force_run = true;
break;
+ case 'I':
+ test_insert = str + 2;
+ break;
}
argv++;
- argc++;
+ argc--;
}
ret = ut_run_list(name, prefix, tests, n_ents,
- argc > 1 ? argv[1] : NULL, runs_per_text, force_run);
+ argc > 1 ? argv[1] : NULL, runs_per_text, force_run,
+ test_insert);
return ret ? CMD_RET_FAILURE : 0;
}