[zorg] r173735 - Consistently indent
David Blaikie
dblaikie at gmail.com
Mon Jan 28 16:44:14 PST 2013
Author: dblaikie
Date: Mon Jan 28 18:44:14 2013
New Revision: 173735
URL: http://llvm.org/viewvc/llvm-project?rev=173735&view=rev
Log:
Consistently indent
There didn't seem to be a prevailing trend (2 v 4 spaces) in the files here,
so I picked one arbitrarily (2 spaces) since this file wasn't even self
consistent.
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=173735&r1=173734&r2=173735&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/commands/LitTestCommand.py (original)
+++ zorg/trunk/zorg/buildbot/commands/LitTestCommand.py Mon Jan 28 18:44:14 2013
@@ -8,68 +8,68 @@ from buildbot.process.buildstep import L
from buildbot.steps.shell import Test
class LitLogObserver(LogLineObserver):
- kTestLineRE = re.compile(r'([^ ]*): (.*) \(.*.*\)')
- kTestFailureLogStartRE = re.compile(r"""\*{4,80} TEST '(.*)' .*""")
- kTestFailureLogStopRE = re.compile(r"""\*{10,80}""")
- def __init__(self):
- LogLineObserver.__init__(self)
- self.resultCounts = {}
+ kTestLineRE = re.compile(r'([^ ]*): (.*) \(.*.*\)')
+ kTestFailureLogStartRE = re.compile(r"""\*{4,80} TEST '(.*)' .*""")
+ kTestFailureLogStopRE = re.compile(r"""\*{10,80}""")
+ def __init__(self):
+ LogLineObserver.__init__(self)
+ self.resultCounts = {}
+ self.inFailure = None
+ def outLineReceived(self, line):
+ # See if we are inside a failure log.
+ if self.inFailure:
+ 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
- def outLineReceived(self, line):
- # See if we are inside a failure log.
- if self.inFailure:
- 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
- return
-
- line = line.strip()
- if not line:
- return
-
- # Check for test failure logs.
- m = self.kTestFailureLogStartRE.match(line)
- if m:
- self.inFailure = (m.group(1), [line])
- return
-
- # Otherwise expect a test status line.
- m = self.kTestLineRE.match(line)
- if m:
- code, name = m.groups()
- if not code in self.resultCounts:
- self.resultCounts[code] = 0
- self.resultCounts[code] += 1
+ return
+
+ line = line.strip()
+ if not line:
+ return
+
+ # Check for test failure logs.
+ m = self.kTestFailureLogStartRE.match(line)
+ if m:
+ self.inFailure = (m.group(1), [line])
+ return
+
+ # Otherwise expect a test status line.
+ m = self.kTestLineRE.match(line)
+ if m:
+ code, name = m.groups()
+ if not code in self.resultCounts:
+ self.resultCounts[code] = 0
+ self.resultCounts[code] += 1
class LitTestCommand(Test):
- resultNames = {'FAIL':'unexpected failures',
- 'PASS':'expected passes',
- 'XFAIL':'expected failures',
- 'XPASS':'unexpected passes',
- 'KFAIL':'known failures',
- 'KPASS':'unknown passes',
- 'UNRESOLVED':'unresolved testcases',
- 'UNTESTED':'untested testcases',
- '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):
- Test.__init__(self, *args, **kwargs)
- self.logObserver = LitLogObserver()
- self.addLogObserver('stdio', self.logObserver)
-
- def evaluateCommand(self, cmd):
- if any([r in self.logObserver.resultCounts for r in self.failingCodes]):
- return FAILURE
- return SUCCESS
-
- def describe(self, done=False):
- description = Test.describe(self, done)
- for name, count in self.logObserver.resultCounts.iteritems():
- description.append('{0} {1}'.format(count, self.resultNames[name]))
- return description
+ resultNames = {'FAIL':'unexpected failures',
+ 'PASS':'expected passes',
+ 'XFAIL':'expected failures',
+ 'XPASS':'unexpected passes',
+ 'KFAIL':'known failures',
+ 'KPASS':'unknown passes',
+ 'UNRESOLVED':'unresolved testcases',
+ 'UNTESTED':'untested testcases',
+ '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):
+ Test.__init__(self, *args, **kwargs)
+ self.logObserver = LitLogObserver()
+ self.addLogObserver('stdio', self.logObserver)
+
+ def evaluateCommand(self, cmd):
+ if any([r in self.logObserver.resultCounts for r in self.failingCodes]):
+ return FAILURE
+ return SUCCESS
+
+ def describe(self, done=False):
+ description = Test.describe(self, done)
+ for name, count in self.logObserver.resultCounts.iteritems():
+ description.append('{0} {1}'.format(count, self.resultNames[name]))
+ return description
More information about the llvm-commits
mailing list