From: Stephen Warren <swarren@nvidia.com>
Date: Thu, 28 Jan 2016 06:57:46 +0000 (-0700)
Subject: test/dm: clear unit test failure count each run
X-Git-Tag: v2025.01-rc5-pxa1908~10441^2~9
X-Git-Url: http://git.dujemihanovic.xyz/html/static/gitweb.css?a=commitdiff_plain;h=26e1beccbeb82ce7a4713ad899eb34b795228891;p=u-boot.git

test/dm: clear unit test failure count each run

The ut command prints a test failure count each time it is executed.
This is stored in a global variable which is never reset. Consequently,
the printed failure count accumulates across runs. Fix this by clearing
the counter each time "ut" is invoked.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
---

diff --git a/test/dm/test-main.c b/test/dm/test-main.c
index 91bdda83ab..f2e0048143 100644
--- a/test/dm/test-main.c
+++ b/test/dm/test-main.c
@@ -81,6 +81,8 @@ static int dm_test_main(const char *test_name)
 	struct unit_test *test;
 	int run_count;
 
+	uts->fail_count = 0;
+
 	/*
 	 * If we have no device tree, or it only has a root node, then these
 	 * tests clearly aren't going to work...