[PATCH] Lit parser should ignore leading whitespace in log file.

Rick Foos rfoos at codeaurora.org
Tue Apr 7 12:48:40 PDT 2015


Drop file not part of change.


http://reviews.llvm.org/D8878

Files:
  zorg/buildbot/commands/LitTestCommand.py

Index: zorg/buildbot/commands/LitTestCommand.py
===================================================================
--- zorg/buildbot/commands/LitTestCommand.py
+++ zorg/buildbot/commands/LitTestCommand.py
@@ -48,7 +48,7 @@
     self.activeVerboseLog.append(line)
 
     # If this is a stop marker, process the test info.
-    if self.kTestVerboseLogStopRE.match(line):
+    if self.kTestVerboseLogStopRE.match(line.strip()):
       self.testInfoFinished()
 
   def testInfoFinished(self):
@@ -225,6 +225,25 @@
 **********"""),
         ('FAIL: test-three', 'FAIL: test-three')])
 
+  def test_indented_log(self):
+    obs = self.parse_log("""
+    FAIL: test-one (1 of 3)
+    FAIL: test-two (2 of 3)
+    **** TEST 'test-two' FAILED ****
+    bla bla bla
+    **********
+    FAIL: test-three (3 of 3)
+""")
+
+    self.assertEqual(obs.resultCounts, { 'FAIL' : 3 })
+    self.assertEqual(obs.step.logs, [
+        ('FAIL: test-one', 'FAIL: test-one'),
+        ('FAIL: test-two', """\
+    **** TEST 'test-two' FAILED ****
+    bla bla bla
+    **********"""),
+        ('FAIL: test-three', 'FAIL: test-three')])
+
 class TestCommand(unittest.TestCase):
   def parse_log(self, text, **kwargs):
     cmd = LitTestCommand(**kwargs)

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8878.23363.patch
Type: text/x-patch
Size: 1232 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150407/24d7c087/attachment.bin>


More information about the llvm-commits mailing list