gdb-buildbot/lib/gdbcommand.py

47 lines
1.7 KiB
Python
Raw Normal View History

2013-08-01 17:32:44 +00:00
# GDB .sum-fetching command.
from buildbot.status.builder import SUCCESS, WARNINGS, FAILURE, EXCEPTION
from buildbot.steps.shell import ShellCommand
from sumfiles import DejaResults
2015-01-23 23:56:28 +00:00
from gdbgitdb import switch_to_branch
2013-08-01 17:32:44 +00:00
class GdbCatSumfileCommand(ShellCommand):
name = 'regressions'
command = ['cat', 'gdb.sum']
def __init__(self, **kwargs):
ShellCommand.__init__(self, **kwargs)
def evaluateCommand(self, cmd):
rev = self.getProperty('got_revision')
builder = self.getProperty('buildername')
istry = self.getProperty('isTryBuilder')
branch = self.getProperty('branch')
if branch is None:
branch = 'master'
2015-01-23 23:56:28 +00:00
# Switch to the right branch inside the BUILDER repo
switch_to_branch (builder, branch)
2013-08-01 17:32:44 +00:00
parser = DejaResults()
cur_results = parser.read_sum_text(self.getLog('stdio').getText())
if not istry or istry == 'no':
2013-08-01 17:32:44 +00:00
baseline = parser.read_baseline (builder, branch)
else:
baseline = parser.read_sum_file(builder, rev)
result = SUCCESS
if baseline is not None:
2015-01-23 23:56:28 +00:00
report = parser.compute_regressions (builder, branch,
cur_results, baseline)
2013-08-01 17:32:44 +00:00
if report is not '':
2015-01-23 23:56:28 +00:00
self.addCompleteLog ('regressions', report)
2013-08-01 17:32:44 +00:00
result = FAILURE
if not istry or istry == 'no':
2015-01-23 23:56:28 +00:00
parser.write_sum_file (cur_results, builder, branch)
2013-08-01 17:32:44 +00:00
# If there was no previous baseline, then this run
# gets the honor.
if baseline is None:
baseline = cur_results
2015-01-23 23:56:28 +00:00
parser.write_baseline (baseline, builder, branch)
2013-08-01 17:32:44 +00:00
return result