[CRIU] [PATCH 2/2] zdtm: print test case summary also if all test cases pass

Adrian Reber adrian at lisas.de
Thu Mar 16 09:38:18 PDT 2017


From: Adrian Reber <areber at redhat.com>

If using the '--keep-going' option, zdtm prints out an overview how many
tests were run, failed and skipped. This would also be useful to know if
it did not fail. This patch changes the output like this:

 ################## ALL TEST(S) PASSED (TOTAL 297/SKIPPED 36) ###################

or in the case of a failure it is unchanged:

 ################### 2 TEST(S) FAILED (TOTAL 297/SKIPPED 34) ####################
  * zdtm/static/sched_policy00(ns)
  * zdtm/static/cgroup02(h)
 ##################################### FAIL #####################################

Signed-off-by: Adrian Reber <areber at redhat.com>
---
 test/zdtm.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/test/zdtm.py b/test/zdtm.py
index b04b779..57e2ab0 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -1524,12 +1524,18 @@ class launcher:
 			self.__fail = True
 		if self.__file_report:
 			self.__file_report.close()
-		if self.__fail:
-			if opts['keep_going']:
+
+		if opts['keep_going']:
+			if self.__fail:
 				print_sep("%d TEST(S) FAILED (TOTAL %d/SKIPPED %d)"
 						% (len(self.__failed), self.__total, self.__nr_skip), "#")
 				for failed in self.__failed:
 					print " * %s(%s)" % (failed[0], failed[1])
+			else:
+				print_sep("ALL TEST(S) PASSED (TOTAL %d/SKIPPED %d)"
+						% (self.__total, self.__nr_skip), "#")
+
+		if self.__fail:
 			print_sep("FAIL", "#")
 			sys.exit(1)
 
-- 
2.9.3



More information about the CRIU mailing list