[zorg] r173736 - Log failure files even for failures that have no context.
David Blaikie
dblaikie at gmail.com
Mon Jan 28 16:44:17 PST 2013
Author: dblaikie
Date: Mon Jan 28 18:44:17 2013
New Revision: 173736
URL: http://llvm.org/viewvc/llvm-project?rev=173736&view=rev
Log:
Log failure files even for failures that have no context.
This assumes context always appears after the failed log line & before any
other result lines.
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=173736&r1=173735&r2=173736&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/commands/LitTestCommand.py (original)
+++ zorg/trunk/zorg/buildbot/commands/LitTestCommand.py Mon Jan 28 18:44:17 2013
@@ -11,18 +11,19 @@ class LitLogObserver(LogLineObserver):
kTestLineRE = re.compile(r'([^ ]*): (.*) \(.*.*\)')
kTestFailureLogStartRE = re.compile(r"""\*{4,80} TEST '(.*)' .*""")
kTestFailureLogStopRE = re.compile(r"""\*{10,80}""")
+ failingCodes = set(['FAIL', 'XPASS', 'KPASS', 'UNRESOLVED'])
def __init__(self):
LogLineObserver.__init__(self)
self.resultCounts = {}
self.inFailure = None
+ self.inFailureContext = False
+ self.failed = False
def outLineReceived(self, line):
# See if we are inside a failure log.
- if self.inFailure:
+ if self.inFailureContext:
self.inFailure[1].append(line)
if self.kTestFailureLogStopRE.match(line):
- name,log = self.inFailure
- self.step.addCompleteLog(name.replace('/', '__'), '\n'.join(log))
- self.inFailure = None
+ self.inFailureContext = False
return
line = line.strip()
@@ -32,13 +33,22 @@ class LitLogObserver(LogLineObserver):
# Check for test failure logs.
m = self.kTestFailureLogStartRE.match(line)
if m:
- self.inFailure = (m.group(1), [line])
+ assert m[0] == self.inFailure[0]
+ self.inFailure[1].append(line)
+ self.inFailureContext = True
return
# Otherwise expect a test status line.
m = self.kTestLineRE.match(line)
if m:
code, name = m.groups()
+ if name != self.inFailure[0]:
+ name,log = self.inFailure
+ self.step.addCompleteLog(name.replace('/', '__'), '\n'.join(log))
+ self.inFailure = None
+ if code in self.failingCodes:
+ self.inFailure = (name, [line])
+ self.Failed = True
if not code in self.resultCounts:
self.resultCounts[code] = 0
self.resultCounts[code] += 1
@@ -55,7 +65,6 @@ class LitTestCommand(Test):
'REGRESSED':'runtime performance regression',
'IMPROVED':'runtime performance improvement',
'UNSUPPORTED':'unsupported tests'}
- failingCodes = set(['FAIL', 'XPASS', 'KPASS', 'UNRESOLVED'])
def __init__(self, ignore=[], flaky=[], max_logs=20,
*args, **kwargs):
@@ -64,7 +73,7 @@ class LitTestCommand(Test):
self.addLogObserver('stdio', self.logObserver)
def evaluateCommand(self, cmd):
- if any([r in self.logObserver.resultCounts for r in self.failingCodes]):
+ if self.logObserver.failed:
return FAILURE
return SUCCESS
More information about the llvm-commits
mailing list