Commit 94dfd0ca authored by Adrian Reber's avatar Adrian Reber Committed by Pavel Emelyanov

zdtm: print a summary of failed tests if using --keep-going

When using the option --keep-going to get a quick overview of the test
results there is now a summary which tests have failed like:

 ############# 7 TEST(S) FAILED (TOTAL 268/SKIPPED 83) ##############
  * zdtm/static/sched_policy00(unknown)
  * zdtm/static/pthread00(unknown)
  * zdtm/static/pthread01(unknown)
  * zdtm/static/maps01(unknown)
  * zdtm/static/maps00(unknown)
  * zdtm/transition/maps008(unknown)
  * zdtm/transition/shmem(unknown)
 ############################### FAIL ###############################
Signed-off-by: 's avatarAdrian Reber <areber@redhat.com>
Acked-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent c64010fe
...@@ -1308,6 +1308,8 @@ class launcher: ...@@ -1308,6 +1308,8 @@ class launcher:
self.__subs = {} self.__subs = {}
self.__fail = False self.__fail = False
self.__file_report = None self.__file_report = None
self.__failed = []
self.__nr_skip = 0
if self.__max > 1 and self.__total > 1: if self.__max > 1 and self.__total > 1:
self.__use_log = True self.__use_log = True
elif opts['report']: elif opts['report']:
...@@ -1338,6 +1340,7 @@ class launcher: ...@@ -1338,6 +1340,7 @@ class launcher:
print "Skipping %s (%s)" % (name, reason) print "Skipping %s (%s)" % (name, reason)
self.__nr += 1 self.__nr += 1
self.__runtest += 1 self.__runtest += 1
self.__nr_skip += 1
if self.__file_report: if self.__file_report:
testline = "ok %d - %s # SKIP %s" % (self.__runtest, name, reason) testline = "ok %d - %s # SKIP %s" % (self.__runtest, name, reason)
print >> self.__file_report, testline print >> self.__file_report, testline
...@@ -1381,6 +1384,7 @@ class launcher: ...@@ -1381,6 +1384,7 @@ class launcher:
if status != 0: if status != 0:
self.__fail = True self.__fail = True
failed_flavor = decode_flav(os.WEXITSTATUS(status)) failed_flavor = decode_flav(os.WEXITSTATUS(status))
self.__failed.append([sub['name'], failed_flavor])
if self.__file_report: if self.__file_report:
testline = "not ok %d - %s # flavor %s" % (self.__runtest, sub['name'], failed_flavor) testline = "not ok %d - %s # flavor %s" % (self.__runtest, sub['name'], failed_flavor)
details = {'output': open(sub['log']).read()} details = {'output': open(sub['log']).read()}
...@@ -1425,6 +1429,11 @@ class launcher: ...@@ -1425,6 +1429,11 @@ class launcher:
if self.__file_report: if self.__file_report:
self.__file_report.close() self.__file_report.close()
if self.__fail: if self.__fail:
if opts['keep_going']:
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])
print_sep("FAIL", "#") print_sep("FAIL", "#")
sys.exit(1) sys.exit(1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment