summaryrefslogtreecommitdiff
path: root/test/dm/cmd_dm.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-06-11 23:29:50 -0600
committerSimon Glass <sjg@chromium.org>2014-06-20 11:55:52 -0600
commitb6a49a7ae71755396a2fa1e6dbde1ae3064d256f (patch)
treef8d1e24e4e2fedab483e528d3063bb4e12b43372 /test/dm/cmd_dm.c
parent89876a55a62f495302e2fd76094e45a65ca188b2 (diff)
downloadu-boot-imx-b6a49a7ae71755396a2fa1e6dbde1ae3064d256f.zip
u-boot-imx-b6a49a7ae71755396a2fa1e6dbde1ae3064d256f.tar.gz
u-boot-imx-b6a49a7ae71755396a2fa1e6dbde1ae3064d256f.tar.bz2
dm: Allow driver model tests only for sandbox
The GPIO tests require the sandbox GPIO driver, so cannot be run on other platforms. Similarly for the 'dm test' command. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/dm/cmd_dm.c')
-rw-r--r--test/dm/cmd_dm.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/dm/cmd_dm.c b/test/dm/cmd_dm.c
index 083f15c..180661b 100644
--- a/test/dm/cmd_dm.c
+++ b/test/dm/cmd_dm.c
@@ -93,16 +93,23 @@ static int do_dm_dump_uclass(cmd_tbl_t *cmdtp, int flag, int argc,
return 0;
}
+#ifdef CONFIG_DM_TEST
static int do_dm_test(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
return dm_test_main();
}
+#define TEST_HELP "\ndm test Run tests"
+#else
+#define TEST_HELP
+#endif
static cmd_tbl_t test_commands[] = {
U_BOOT_CMD_MKENT(tree, 0, 1, do_dm_dump_all, "", ""),
U_BOOT_CMD_MKENT(uclass, 1, 1, do_dm_dump_uclass, "", ""),
+#ifdef CONFIG_DM_TEST
U_BOOT_CMD_MKENT(test, 1, 1, do_dm_test, "", ""),
+#endif
};
static int do_dm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
@@ -128,6 +135,6 @@ U_BOOT_CMD(
dm, 2, 1, do_dm,
"Driver model low level access",
"tree Dump driver model tree\n"
- "dm uclass Dump list of instances for each uclass\n"
- "dm test Run tests"
+ "dm uclass Dump list of instances for each uclass"
+ TEST_HELP
);