Print the names of unit tests that fail in the task collector

This commit is contained in:
Gustavo J. A. M. Carneiro
2009-06-30 10:46:57 +01:00
parent 771e01ad47
commit a496294283

10
wscript
View File

@@ -732,12 +732,14 @@ class collect_unit_test_results_task(Task.TaskBase):
return Task.RUN_ME
def run(self):
failed = 0
failed_tasks = []
for task in self.test_tasks:
if task.retval:
failed += 1
if failed:
print "C++ UNIT TESTS: %i tests passed, %i failed." % (len(self.test_tasks) - failed, failed)
failed_tasks.append(task)
if failed_tasks:
print "C++ UNIT TESTS: %i tests passed, %i failed (%s)." % \
(len(self.test_tasks) - len(failed_tasks), len(failed_tasks),
', '.join(t.name_of_test for t in failed_tasks))
return 1
else:
print "C++ UNIT TESTS: all %i tests passed." % (len(self.test_tasks),)