summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-11-25 11:57:30 -0700
committerTom Rini <trini@konsulko.com>2017-12-02 18:32:58 -0500
commite93232e15ec9fb42a6f856b612c7b64792e533c2 (patch)
tree7ab82b9f93264b2b7c1ff12107b8ad2b33ff13cd /test
parent4d869c1e49e5a276bd53f50a83e78999a25e2846 (diff)
test: overlay: Use cmd_ut_category()
Adjust the code to use the common test-execution function. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/overlay/cmd_ut_overlay.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/test/overlay/cmd_ut_overlay.c b/test/overlay/cmd_ut_overlay.c
index c730a11f51..6279e6d0c2 100644
--- a/test/overlay/cmd_ut_overlay.c
+++ b/test/overlay/cmd_ut_overlay.c
@@ -14,6 +14,7 @@
#include <test/ut.h>
#include <test/overlay.h>
+#include <test/suites.h>
/* 4k ought to be enough for anybody */
#define FDT_COPY_SIZE (4 * SZ_1K)
@@ -221,7 +222,6 @@ int do_ut_overlay(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
overlay_test);
const int n_ents = ll_entry_count(struct unit_test, overlay_test);
struct unit_test_state *uts;
- struct unit_test *test;
void *fdt_base = &__dtb_test_fdt_base_begin;
void *fdt_overlay = &__dtb_test_fdt_overlay_begin;
void *fdt_overlay_stacked = &__dtb_test_fdt_overlay_stacked_begin;
@@ -280,24 +280,7 @@ int do_ut_overlay(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
/* Apply the stacked overlay */
ut_assertok(fdt_overlay_apply(fdt_base_copy, fdt_overlay_stacked_copy));
- if (argc == 1)
- printf("Running %d environment tests\n", n_ents);
-
- for (test = tests; test < tests + n_ents; test++) {
- if (argc > 1 && strcmp(argv[1], test->name))
- continue;
- printf("Test: %s\n", test->name);
-
- uts->start = mallinfo();
-
- test->func(uts);
- }
-
- printf("Failures: %d\n", uts->fail_count);
- if (!uts->fail_count)
- ret = 0;
- else
- ret = CMD_RET_FAILURE;
+ ret = cmd_ut_category("overlay", tests, n_ents, argc, argv);
free(fdt_overlay_stacked_copy);
err3: