[PATCH 08/17] test: Tidy up help for ut command

Simon Glass sjg at chromium.org
Sun Oct 30 02:47:10 CET 2022


Sort this and put the command summary at the top instead of the bottom.

Adjust it so that the newlines are at the start of the strings, so that
there is not a blank line at the end.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 test/cmd_ut.c | 57 +++++++++++++++++++++++++++++----------------------
 1 file changed, 32 insertions(+), 25 deletions(-)

diff --git a/test/cmd_ut.c b/test/cmd_ut.c
index 719cb7e19c8..81433cd36f4 100644
--- a/test/cmd_ut.c
+++ b/test/cmd_ut.c
@@ -137,56 +137,63 @@ static int do_ut(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 
 #ifdef CONFIG_SYS_LONGHELP
 static char ut_help_text[] =
-	"all - execute all enabled tests\n"
+	"[-r] [-f] [<suite>] - run unit tests\n"
+	"   -r<runs>   Number of times to run each test\n"
+	"   -f         Force 'manual' tests to run as well\n"
+	"   <suite>    Test suite to run, or all\n"
+	"\n"
+	"Suites:"
+	"\nall - execute all enabled tests"
+#ifdef CONFIG_CMD_ADDRMAP
+	"\naddrmap - very basic test of addrmap command"
+#endif
 #ifdef CONFIG_SANDBOX
-	"ut bloblist - Test bloblist implementation\n"
-	"ut compression - Test compressors and bootm decompression\n"
+	"\nbloblist - bloblist implementation"
 #endif
 #ifdef CONFIG_BOOTSTD
-	"ut bootstd - Test standard boot implementation\n"
+	"\nbootstd - standard boot implementation"
+#endif
+#ifdef CONFIG_SANDBOX
+	"\ncompression - compressors and bootm decompression"
 #endif
 #ifdef CONFIG_UT_DM
-	"ut dm [test-name]\n"
+	"\ndm - driver model"
 #endif
 #ifdef CONFIG_UT_ENV
-	"ut env [test-name]\n"
+	"\nenv - environment"
 #endif
 #ifdef CONFIG_CMD_FDT
-	"ut fdt [test-name] - test of the fdt command\n"
+	"\nfdt - fdt command"
+#endif
+#ifdef CONFIG_CMD_LOADM
+	"\nloadm - loadm command parameters and loading memory blob"
 #endif
 #ifdef CONFIG_UT_LIB
-	"ut lib [test-name] - test library functions\n"
+	"\nlib - library functions"
 #endif
 #ifdef CONFIG_UT_LOG
-	"ut log [test-name] - test logging functions\n"
+	"\nlog - logging functions"
 #endif
-	"ut mem [test-name] - test memory-related commands\n"
+	"\nmem - memory-related commands"
 #ifdef CONFIG_UT_OPTEE
-	"ut optee [test-name]\n"
+	"\noptee - test OP-TEE"
 #endif
 #ifdef CONFIG_UT_OVERLAY
-	"ut overlay [test-name]\n"
+	"\noverlay - device tree overlays"
 #endif
-	"ut print [test-name]  - test printing\n"
-	"ut setexpr [test-name] - test setexpr command\n"
+	"\nprint  - printing things to the console"
+	"\nsetexpr - setexpr command"
 #ifdef CONFIG_SANDBOX
-	"ut str - Basic test of string functions\n"
+	"\nstr - basic test of string functions"
 #endif
 #ifdef CONFIG_UT_TIME
-	"ut time - Very basic test of time functions\n"
+	"\ntime - very basic test of time functions"
 #endif
 #if defined(CONFIG_UT_UNICODE) && \
 	!defined(CONFIG_SPL_BUILD) && !defined(API_BUILD)
-	"ut unicode [test-name] - test Unicode functions\n"
-#endif
-#ifdef CONFIG_CMD_ADDRMAP
-	"ut addrmap - Very basic test of addrmap command\n"
-#endif
-#ifdef CONFIG_CMD_LOADM
-	"ut loadm [test-name]- test of parameters and load memory blob\n"
+	"\nunicode - Unicode functions"
 #endif
-	"All commands accept an optional [-r<runs>] flag before [test-name], to\n"
-	"run each test multiple times (<runs> is in decimal)";
+	;
 #endif /* CONFIG_SYS_LONGHELP */
 
 U_BOOT_CMD(
-- 
2.38.1.273.g43a17bfeac-goog



More information about the U-Boot mailing list