Don't print "Command output (stdout):" when the command has no output,
authorDan Gohman <gohman@apple.com>
Wed, 4 Aug 2010 00:05:16 +0000 (00:05 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 4 Aug 2010 00:05:16 +0000 (00:05 +0000)
and same for stderr, to avoid clutter in the output.

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

utils/lit/lit/TestRunner.py

index f653245b22e380dab19bf2f44e6744e29c1ff3dc..e0c2962d22ae03c3a7422448e8a227f506d4377e 100644 (file)
@@ -487,14 +487,16 @@ def formatTestOutput(status, out, err, exitCode, script):
     print >>output, '\n'.join(script)
     print >>output, "--"
     print >>output, "Exit Code: %r" % exitCode
-    print >>output, "Command Output (stdout):"
-    print >>output, "--"
-    output.write(out)
-    print >>output, "--"
-    print >>output, "Command Output (stderr):"
-    print >>output, "--"
-    output.write(err)
-    print >>output, "--"
+    if out:
+        print >>output, "Command Output (stdout):"
+        print >>output, "--"
+        output.write(out)
+        print >>output, "--"
+    if err:
+        print >>output, "Command Output (stderr):"
+        print >>output, "--"
+        output.write(err)
+        print >>output, "--"
     return (status, output.getvalue())
 
 def executeTclTest(test, litConfig):