lit: Add '-a' option to display commands+output of all tests
authorMatthias Braun <matze@braunis.de>
Mon, 2 Nov 2015 16:13:46 +0000 (16:13 +0000)
committerMatthias Braun <matze@braunis.de>
Mon, 2 Nov 2015 16:13:46 +0000 (16:13 +0000)
The existing -v option only displays commands and outputs for failed
tests, the newly introduced -a displays it for all executed tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251806 91177308-0d34-0410-b5e6-96231b3b80d8

utils/lit/lit/main.py

index 45ec86d1c3ffa7dbe647475959c18b761438b59f..18c4a8c3aaec678bbd95a2dcc1d91672cafa084f 100755 (executable)
@@ -56,9 +56,11 @@ class TestingProgressDisplay(object):
                                      self.completed, self.numTests))
 
         # Show the test failure output, if requested.
-        if test.result.code.isFailure and self.opts.showOutput:
-            print("%s TEST '%s' FAILED %s" % ('*'*20, test.getFullName(),
-                                              '*'*20))
+        if (test.result.code.isFailure and self.opts.showOutput) or \
+           self.opts.showAllOutput:
+            if test.result.code.isFailure:
+                print("%s TEST '%s' FAILED %s" % ('*'*20, test.getFullName(),
+                                                  '*'*20))
             print(test.result.output)
             print("*" * 20)
 
@@ -161,7 +163,10 @@ def main(builtinParameters = {}):
                      help="Reduce amount of output",
                      action="store_true", default=False)
     group.add_option("-v", "--verbose", dest="showOutput",
-                     help="Show all test output",
+                     help="Show test output for failures",
+                     action="store_true", default=False)
+    group.add_option("-a", "--show-all", dest="showAllOutput",
+                     help="Display all commandlines and output",
                      action="store_true", default=False)
     group.add_option("-o", "--output", dest="output_path",
                      help="Write test results to the provided path",