CPPUnit Interpretation
This subclass of Test will interpret cppunit output.
#Extended from Buildbot default Test class by Jonathan S. Romero (jonnyro@jonnyro.com)
# based on examples found in buildbot release.
class CPPUnitTest(Test):
def __init__(self, **kwargs):
Test.__init__(self, **kwargs) # always upcall!
def evaluateCommand(self, cmd):
# Get stdio, stripping pesky newlines etc.
lines = map(
lambda line : line.replace('\r\n','').replace('\r','').replace('\n',''),
self.getLog('stdio').readlines()
)
total = 0
passed = 0
failed = 0
rc = cmd.rc
lines.reverse()
print lines[0]
m = re.match(r'OK \((\d*)\)', lines[0])
if m != None:
total = int(m.group(1))
passed = int(m.group(1))
failed = 0
else:
m = re.match(r'Run\:\ (\d*).*Failure total\:\ (\d*).*Failures\:\ (\d*).*Errors\:\ (\d*)', lines[0])
if m != None:
total = int(m.group(1))
failed = int(m.group(2))
passed = total - failed
self.setTestResults(total=total, failed=failed, passed=passed)
return rc
![[Buildbot Logo]](/trac/chrome/site/header-text-transparent.png)