Print the names of unit tests that fail in the task collector
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Tue, 30 Jun 2009 10:46:57 +0100
changeset 4626 a7b70048bd4a
parent 4625 615583240b77
child 4627 d132345b3e10
Print the names of unit tests that fail in the task collector
wscript
--- a/wscript	Fri Jun 26 19:05:28 2009 -0700
+++ b/wscript	Tue Jun 30 10:46:57 2009 +0100
@@ -732,12 +732,14 @@
         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),)