diff options
author | Simon Glass <sjg@chromium.org> | 2015-03-25 18:23:04 (GMT) |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-04-18 17:11:30 (GMT) |
commit | 57f54d55bdf7a21034182cf213c1084df214d98c (patch) | |
tree | eabcdf89497ebccbae438200ad6be9ebcfe161f2 /test/dm/test-main.c | |
parent | b66c0a662b29127bc67f1a70b38ea0966c32ec90 (diff) | |
download | u-boot-fsl-qoriq-57f54d55bdf7a21034182cf213c1084df214d98c.tar.xz |
dm: test: Allow 'dm test' to select a particular test to run
As well as running all tests, it is useful to be able to run a selected test.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'test/dm/test-main.c')
-rw-r--r-- | test/dm/test-main.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/dm/test-main.c b/test/dm/test-main.c index 90ca810..a47bb37 100644 --- a/test/dm/test-main.c +++ b/test/dm/test-main.c @@ -65,7 +65,7 @@ static int dm_test_destroy(struct dm_test_state *dms) return 0; } -int dm_test_main(void) +int dm_test_main(const char *test_name) { struct dm_test *tests = ll_entry_start(struct dm_test, dm_test); const int n_ents = ll_entry_count(struct dm_test, dm_test); @@ -83,9 +83,12 @@ int dm_test_main(void) ut_assert(gd->fdt_blob); } - printf("Running %d driver model tests\n", n_ents); + if (!test_name) + printf("Running %d driver model tests\n", n_ents); for (test = tests; test < tests + n_ents; test++) { + if (test_name && strcmp(test_name, test->name)) + continue; printf("Test: %s\n", test->name); ut_assertok(dm_test_init(dms)); |