summaryrefslogtreecommitdiff
path: root/test/cmd_ut.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2025-01-20 14:25:30 -0700
committerTom Rini <trini@konsulko.com>2025-01-24 14:34:40 -0600
commit67f84dba6b90a938cab891d8f71122e10fb99add (patch)
tree23b269c2d7a83f35bd889cf6e634e38e505f1f88 /test/cmd_ut.c
parent4d31a3bd3370f8fc9d1a484129770a4de4a15d70 (diff)
test: Update ut info to show suites
It is helpful to see a list of available suites. At present this is handled by the longhelp for the 'ut' command, but this is not in a format which can be easily parsed by python tests. Add a -s option to show this. At present it is not possible to show the number of tests in each suite, but future work will address this. For now, show a ? Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/cmd_ut.c')
-rw-r--r--test/cmd_ut.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/cmd_ut.c b/test/cmd_ut.c
index 69f0230e556..3e78d072b3d 100644
--- a/test/cmd_ut.c
+++ b/test/cmd_ut.c
@@ -153,9 +153,21 @@ static int do_ut_all(struct cmd_tbl *cmdtp, int flag, int argc,
static int do_ut_info(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
+ const char *flags;
+
printf("Test suites: %d\n", (int)ARRAY_SIZE(cmd_ut_sub));
printf("Total tests: %d\n", (int)UNIT_TEST_ALL_COUNT());
+ flags = cmd_arg1(argc, argv);
+ if (flags && !strcmp("-s", flags)) {
+ int i;
+
+ puts("\nTests Suite\n");
+ puts("----- -----\n");
+ for (i = 1; i < ARRAY_SIZE(cmd_ut_sub); i++)
+ printf("%5s %s\n", "?", cmd_ut_sub[i].name);
+ }
+
return 0;
}
@@ -186,7 +198,7 @@ U_BOOT_LONGHELP(ut,
"\n"
"\nOptions for <suite>:"
"\nall - execute all enabled tests"
- "\ninfo - show info about tests"
+ "\ninfo [-s] - show info about tests [and suites]"
#ifdef CONFIG_CMD_ADDRMAP
"\naddrmap - very basic test of addrmap command"
#endif