Package buildbot :: Package steps :: Module maxq
[frames] | no frames]

Source Code for Module buildbot.steps.maxq

 1  # This file is part of Buildbot.  Buildbot is free software: you can 
 2  # redistribute it and/or modify it under the terms of the GNU General Public 
 3  # License as published by the Free Software Foundation, version 2. 
 4  # 
 5  # This program is distributed in the hope that it will be useful, but WITHOUT 
 6  # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
 7  # FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more 
 8  # details. 
 9  # 
10  # You should have received a copy of the GNU General Public License along with 
11  # this program; if not, write to the Free Software Foundation, Inc., 51 
12  # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 
13  # 
14  # Copyright Buildbot Team Members 
15   
16  from buildbot.steps.shell import ShellCommand 
17  from buildbot.status.results import SUCCESS, FAILURE 
18  from buildbot import config 
19   
20 -class MaxQ(ShellCommand):
21 flunkOnFailure = True 22 name = "maxq" 23
24 - def __init__(self, testdir=None, **kwargs):
25 if not testdir: 26 config.error("please pass testdir") 27 kwargs['command'] = 'run_maxq.py %s' % (testdir,) 28 ShellCommand.__init__(self, **kwargs) 29 self.addFactoryArguments(testdir=testdir)
30
31 - def commandComplete(self, cmd):
32 output = cmd.logs['stdio'].getText() 33 self.failures = output.count('\nTEST FAILURE:')
34
35 - def evaluateCommand(self, cmd):
36 # treat a nonzero exit status as a failure, if no other failures are 37 # detected 38 if not self.failures and cmd.rc != 0: 39 self.failures = 1 40 if self.failures: 41 return FAILURE 42 return SUCCESS
43
44 - def getText(self, cmd, results):
45 if self.failures: 46 return [ str(self.failures), 'maxq', 'failures' ] 47 return ['maxq', 'tests']
48