Merge tag 'u-boot-amlogic-20200428' of https://gitlab.denx.de/u-boot/custodians/u...
[oweals/u-boot.git] / test / cmd_ut.c
index 400719e7b67935af9c885cc53d44fbcbfa199fd8..bd20a69c55219baceae71dc1d5da5e9c168f0a13 100644 (file)
@@ -26,7 +26,7 @@ int cmd_ut_category(const char *name, const char *prefix,
                const char *test_name = test->name;
 
                /* Remove the prefix */
-               if (!strncmp(test_name, prefix, prefix_len))
+               if (prefix && !strncmp(test_name, prefix, prefix_len))
                        test_name += prefix_len;
 
                if (argc > 1 && strcmp(argv[1], test_name))
@@ -60,6 +60,9 @@ static cmd_tbl_t cmd_ut_sub[] = {
 #ifdef CONFIG_UT_LIB
        U_BOOT_CMD_MKENT(lib, CONFIG_SYS_MAXARGS, 1, do_ut_lib, "", ""),
 #endif
+#ifdef CONFIG_UT_LOG
+       U_BOOT_CMD_MKENT(log, CONFIG_SYS_MAXARGS, 1, do_ut_log, "", ""),
+#endif
 #ifdef CONFIG_UT_TIME
        U_BOOT_CMD_MKENT(time, CONFIG_SYS_MAXARGS, 1, do_ut_time, "", ""),
 #endif
@@ -71,6 +74,8 @@ static cmd_tbl_t cmd_ut_sub[] = {
                         "", ""),
        U_BOOT_CMD_MKENT(bloblist, CONFIG_SYS_MAXARGS, 1, do_ut_bloblist,
                         "", ""),
+       U_BOOT_CMD_MKENT(str, CONFIG_SYS_MAXARGS, 1, do_ut_str,
+                        "", ""),
 #endif
 };
 
@@ -125,12 +130,18 @@ static char ut_help_text[] =
 #ifdef CONFIG_UT_LIB
        "ut lib [test-name] - test library functions\n"
 #endif
+#ifdef CONFIG_UT_LOG
+       "ut log [test-name] - test logging functions\n"
+#endif
 #ifdef CONFIG_UT_OPTEE
        "ut optee [test-name]\n"
 #endif
 #ifdef CONFIG_UT_OVERLAY
        "ut overlay [test-name]\n"
 #endif
+#ifdef CONFIG_SANDBOX
+       "ut str - Basic test of string functions\n"
+#endif
 #ifdef CONFIG_UT_TIME
        "ut time - Very basic test of time functions\n"
 #endif