All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/5] test: overlay: Use cmd_ut_category()
Date: Sat, 25 Nov 2017 11:57:30 -0700	[thread overview]
Message-ID: <20171125185733.40599-3-sjg@chromium.org> (raw)
In-Reply-To: <20171125185733.40599-1-sjg@chromium.org>

Adjust the code to use the common test-execution function.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 test/overlay/cmd_ut_overlay.c | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)

diff --git a/test/overlay/cmd_ut_overlay.c b/test/overlay/cmd_ut_overlay.c
index c730a11f518..6279e6d0c20 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:
-- 
2.15.0.417.g466bffb3ac-goog

  parent reply	other threads:[~2017-11-25 18:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-25 18:57 [U-Boot] [PATCH 0/5] test: Add compression tests to pytest Simon Glass
2017-11-25 18:57 ` [U-Boot] [PATCH 1/5] test: Add a command function for test execution Simon Glass
2017-12-04 18:35   ` [U-Boot] [U-Boot, " Tom Rini
2017-11-25 18:57 ` Simon Glass [this message]
2017-12-04 18:35   ` [U-Boot] [U-Boot,2/5] test: overlay: Use cmd_ut_category() Tom Rini
2017-12-04 18:35   ` Tom Rini
2017-11-25 18:57 ` [U-Boot] [PATCH 3/5] test: compression: Put test variables in a struct Simon Glass
2017-12-04 18:35   ` [U-Boot] [U-Boot, " Tom Rini
2017-11-25 18:57 ` [U-Boot] [PATCH 4/5] test/py: Allow any unit test suite to be found Simon Glass
2017-11-27 18:08   ` Stephen Warren
2017-12-04 18:35   ` [U-Boot] [U-Boot, " Tom Rini
2017-11-25 18:57 ` [U-Boot] [PATCH 5/5] test: compression: Convert to unit test framework Simon Glass
2017-12-04 18:35   ` [U-Boot] [U-Boot, " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171125185733.40599-3-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.