[zorg] r174533 - LitTestCommand: Include the verbose log start/stop markers in the extracted log.

Daniel Dunbar daniel at zuster.org
Wed Feb 6 11:41:05 PST 2013


Author: ddunbar
Date: Wed Feb  6 13:41:05 2013
New Revision: 174533

URL: http://llvm.org/viewvc/llvm-project?rev=174533&view=rev
Log:
LitTestCommand: Include the verbose log start/stop markers in the extracted log.

 - The start marker in particular is a nice header for the log, and clearly
   calls out the test name. The stop marker is just nice to include for bracing
   the text and matching up to the lit output.

Modified:
    zorg/trunk/zorg/buildbot/commands/LitTestCommand.py

Modified: zorg/trunk/zorg/buildbot/commands/LitTestCommand.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/commands/LitTestCommand.py?rev=174533&r1=174532&r2=174533&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/commands/LitTestCommand.py (original)
+++ zorg/trunk/zorg/buildbot/commands/LitTestCommand.py Wed Feb  6 13:41:05 2013
@@ -38,13 +38,12 @@ class LitLogObserver(LogLineObserver):
         return True
 
   def handleVerboseLogLine(self, line):
-    # If this isn't a stop marker, just append it and continue.
-    if not self.kTestVerboseLogStopRE.match(line):
-      self.activeVerboseLog.append(line)
-      return
+    # Append to the log.
+    self.activeVerboseLog.append(line)
 
-    # Otherwise, the log and test info are finished.
-    self.testInfoFinished()
+    # If this is a stop marker, process the test info.
+    if self.kTestVerboseLogStopRE.match(line):
+      self.testInfoFinished()
 
   def testInfoFinished(self):
     # We have finished getting information for one test, handle it.
@@ -77,7 +76,7 @@ class LitLogObserver(LogLineObserver):
     # Check for the test verbose log start marker.
     m = self.kTestVerboseLogStartRE.match(line.strip())
     if m:
-      self.activeVerboseLog = []
+      self.activeVerboseLog = [line]
       if m.group(1) != self.lastTestResult[1]:
         # This is bogus, the verbose log test name doesn't match what we
         # expect. Just note it in the log but otherwise accumulate as normal.
@@ -176,7 +175,7 @@ PASS: test-three (3 of 3)
     obs = self.parse_log("""
 FAIL: test-one (1 of 3)
 FAIL: test-two (2 of 3)
-**** TEST 'test-two' ****
+**** TEST 'test-two' FAILED ****
 bla bla bla
 **********
 FAIL: test-three (3 of 3)
@@ -185,7 +184,10 @@ FAIL: test-three (3 of 3)
     self.assertEqual(obs.resultCounts, { 'FAIL' : 3 })
     self.assertEqual(obs.step.logs, [
         ('test-one', 'FAIL: test-one'),
-        ('test-two', 'bla bla bla'),
+        ('test-two', """\
+**** TEST 'test-two' FAILED ****
+bla bla bla
+**********"""),
         ('test-three', 'FAIL: test-three')])
 
 class TestCommand(unittest.TestCase):





More information about the llvm-commits mailing list