]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
test: dm: Move the time test over to the ut command
authorJoe Hershberger <joe.hershberger@ni.com>
Wed, 20 May 2015 19:27:30 +0000 (14:27 -0500)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 20:43:17 +0000 (22:43 +0200)
Unify the command for running unit tests further by moving the "ut_time"
command over to "ut time".

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
configs/sandbox_defconfig
include/test/suites.h
test/Kconfig
test/Makefile
test/cmd_ut.c
test/time_ut.c

index e69f1475c4b0cc3a24c39cd616d368b42fa2c652..7b5ef2bc368d0a55ddcafde94870a89f6646fd05 100644 (file)
@@ -37,5 +37,5 @@ CONFIG_USB_EMUL=y
 CONFIG_USB_STORAGE=y
 CONFIG_DM_RTC=y
 CONFIG_ERRNO_STR=y
-CONFIG_CMD_UT_TIME=y
+CONFIG_UT_TIME=y
 CONFIG_UT_DM=y
index 27813a362ec1a8d2386485db0960b9208af5ec9d..f68cdec12aa71f977552fa0d9e855fb41bfcb4f8 100644 (file)
@@ -9,5 +9,6 @@
 #define __TEST_SUITES_H__
 
 int do_ut_dm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
+int do_ut_time(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 
 #endif /* __TEST_SUITES_H__ */
index 6f918edfea93e21920d288272d30ab0d10dfd470..32a974e28c8a82986bde2b3327933e0c757edff1 100644 (file)
@@ -1,10 +1,11 @@
 config UNIT_TEST
        bool
 
-config CMD_UT_TIME
+config UT_TIME
        bool "Unit tests for time functions"
+       select UNIT_TEST
        help
-         Enables the 'ut_time' command which tests that the time functions
+         Enables the 'ut time' command which tests that the time functions
          work correctly. The test is fairly simple and will not catch all
          problems. But if you are having problems with udelay() and the like,
          this is a good place to start.
index 3d9968c76dbe70d6b4bec251eafc4a73dc812d5e..0f5de5739908f07976ba2328bd944726e08ac7b2 100644 (file)
@@ -8,4 +8,4 @@ obj-$(CONFIG_UNIT_TEST) += cmd_ut.o
 obj-$(CONFIG_UNIT_TEST) += ut.o
 obj-$(CONFIG_SANDBOX) += command_ut.o
 obj-$(CONFIG_SANDBOX) += compression.o
-obj-$(CONFIG_CMD_UT_TIME) += time_ut.o
+obj-$(CONFIG_UT_TIME) += time_ut.o
index 08001cdbc0f0f0f20b9b0387c2a10c9587c287c2..a65bfeaf3122da5068d5d37e051995068f94d5a1 100644 (file)
@@ -16,6 +16,9 @@ static cmd_tbl_t cmd_ut_sub[] = {
 #if defined(CONFIG_UT_DM)
        U_BOOT_CMD_MKENT(dm, CONFIG_SYS_MAXARGS, 1, do_ut_dm, "", ""),
 #endif
+#ifdef CONFIG_UT_TIME
+       U_BOOT_CMD_MKENT(time, CONFIG_SYS_MAXARGS, 1, do_ut_time, "", ""),
+#endif
 };
 
 static int do_ut_all(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
@@ -58,6 +61,9 @@ static char ut_help_text[] =
        "all - execute all enabled tests\n"
 #ifdef CONFIG_UT_DM
        "ut dm [test-name]\n"
+#endif
+#ifdef CONFIG_UT_TIME
+       "ut time - Very basic test of time functions\n"
 #endif
        ;
 #endif
index 6b52245d7ffa55f9b3c453d2a078c2da93c67a01..8ca9fcb6aae39435407b5f2464513f37c4e0e32e 100644 (file)
@@ -116,7 +116,7 @@ static int test_udelay(void)
        return 0;
 }
 
-static int do_ut_time(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_ut_time(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        int ret = 0;
 
@@ -129,9 +129,3 @@ static int do_ut_time(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
        return ret ? CMD_RET_FAILURE : CMD_RET_SUCCESS;
 }
-
-U_BOOT_CMD(
-       ut_time,        1,      1,      do_ut_time,
-       "Very basic test of time functions",
-       ""
-);