dm: core: support reading a single indexed u32 value
[oweals/u-boot.git] / test / cmd_ut.c
index 400719e7b67935af9c885cc53d44fbcbfa199fd8..7fdcdbb1a63760beada556b87abee4a85c4ea7a1 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
@@ -125,6 +128,9 @@ 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