[zorg] r234454 - [zorg] Lit parser should ignore leading whitespace in log file.
Rick Foos
rfoos at codeaurora.org
Wed Apr 8 16:23:06 PDT 2015
Author: rfoos
Date: Wed Apr 8 18:23:06 2015
New Revision: 234454
URL: http://llvm.org/viewvc/llvm-project?rev=234454&view=rev
Log:
[zorg] Lit parser should ignore leading whitespace in log file.
Summary:
Use case: MSBuild indents Lit test output, and test results are not displayed.
Everything except the Stop RE strips the log line, and this one line change allows indented logs to be displayed.
Reviewers: gkistanova
Reviewed By: gkistanova
Subscribers: llvm-commits
Projects: #zorg
Differential Revision: http://reviews.llvm.org/D8878
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=234454&r1=234453&r2=234454&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/commands/LitTestCommand.py (original)
+++ zorg/trunk/zorg/buildbot/commands/LitTestCommand.py Wed Apr 8 18:23:06 2015
@@ -48,7 +48,7 @@ class LitLogObserver(LogLineObserver):
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 @@ bla bla bla
**********"""),
('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)
More information about the llvm-commits
mailing list