diff mbox series

[U-Boot,008/126] dm: test: Don't fail when tests are skipped due to build

Message ID 20190925145750.200592-9-sjg@chromium.org
State Accepted
Commit ad9504793622c3c745460572b236109e2d69bae4
Delegated to: Bin Meng
Headers show
Series x86: Add initial support for apollolake | expand

Commit Message

Simon Glass Sept. 25, 2019, 2:55 p.m. UTC
At present tests that are marked as only for livetree fail when executed
on sandbox_flattree. They cannot actually be executed, but we should not
resport them as 'not found', since this causes errors. Instead, they
should be silently skipped.

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

 test/dm/test-main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Bin Meng Oct. 4, 2019, 9:44 a.m. UTC | #1
On Wed, Sep 25, 2019 at 10:58 PM Simon Glass <sjg@chromium.org> wrote:
>
> At present tests that are marked as only for livetree fail when executed
> on sandbox_flattree. They cannot actually be executed, but we should not
> resport them as 'not found', since this causes errors. Instead, they
> should be silently skipped.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  test/dm/test-main.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Bin Meng Oct. 6, 2019, 9:15 a.m. UTC | #2
On Fri, Oct 4, 2019 at 5:44 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> On Wed, Sep 25, 2019 at 10:58 PM Simon Glass <sjg@chromium.org> wrote:
> >
> > At present tests that are marked as only for livetree fail when executed
> > on sandbox_flattree. They cannot actually be executed, but we should not
> > resport them as 'not found', since this causes errors. Instead, they
> > should be silently skipped.
> >
> > Signed-off-by: Simon Glass <sjg@chromium.org>
> > ---
> >
> >  test/dm/test-main.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

applied to u-boot-x86/next, thanks!
diff mbox series

Patch

diff --git a/test/dm/test-main.c b/test/dm/test-main.c
index 487d8b96275..74f77ccc849 100644
--- a/test/dm/test-main.c
+++ b/test/dm/test-main.c
@@ -130,7 +130,7 @@  static int dm_test_main(const char *test_name)
 	const int n_ents = ll_entry_count(struct unit_test, dm_test);
 	struct unit_test_state *uts = &global_dm_test_state;
 	struct unit_test *test;
-	int run_count;
+	int found;
 
 	uts->priv = &_global_priv_dm_test_state;
 	uts->fail_count = 0;
@@ -148,7 +148,7 @@  static int dm_test_main(const char *test_name)
 	if (!test_name)
 		printf("Running %d driver model tests\n", n_ents);
 
-	run_count = 0;
+	found = 0;
 #ifdef CONFIG_OF_LIVE
 	uts->of_root = gd->of_root;
 #endif
@@ -180,10 +180,10 @@  static int dm_test_main(const char *test_name)
 			ut_assertok(dm_do_test(uts, test, false));
 			runs++;
 		}
-		run_count += runs;
+		found++;
 	}
 
-	if (test_name && !run_count)
+	if (test_name && !found)
 		printf("Test '%s' not found\n", test_name);
 	else
 		printf("Failures: %d\n", uts->fail_count);