Commit b6a49a7ae71755396a2fa1e6dbde1ae3064d256f

Authored by Simon Glass
1 parent 89876a55a6

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>

Showing 2 changed files with 11 additions and 2 deletions Side-by-side Diff

... ... @@ -15,5 +15,7 @@
15 15 # subsystem you must add sandbox tests here.
16 16 obj-$(CONFIG_DM_TEST) += core.o
17 17 obj-$(CONFIG_DM_TEST) += ut.o
  18 +ifneq ($(CONFIG_SANDBOX),)
18 19 obj-$(CONFIG_DM_GPIO) += gpio.o
  20 +endif
... ... @@ -93,16 +93,23 @@
93 93 return 0;
94 94 }
95 95  
  96 +#ifdef CONFIG_DM_TEST
96 97 static int do_dm_test(cmd_tbl_t *cmdtp, int flag, int argc,
97 98 char * const argv[])
98 99 {
99 100 return dm_test_main();
100 101 }
  102 +#define TEST_HELP "\ndm test Run tests"
  103 +#else
  104 +#define TEST_HELP
  105 +#endif
101 106  
102 107 static cmd_tbl_t test_commands[] = {
103 108 U_BOOT_CMD_MKENT(tree, 0, 1, do_dm_dump_all, "", ""),
104 109 U_BOOT_CMD_MKENT(uclass, 1, 1, do_dm_dump_uclass, "", ""),
  110 +#ifdef CONFIG_DM_TEST
105 111 U_BOOT_CMD_MKENT(test, 1, 1, do_dm_test, "", ""),
  112 +#endif
106 113 };
107 114  
108 115 static int do_dm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
... ... @@ -128,7 +135,7 @@
128 135 dm, 2, 1, do_dm,
129 136 "Driver model low level access",
130 137 "tree Dump driver model tree\n"
131   - "dm uclass Dump list of instances for each uclass\n"
132   - "dm test Run tests"
  138 + "dm uclass Dump list of instances for each uclass"
  139 + TEST_HELP
133 140 );