1   
  2   
  3   
  4   
  5   
  6   
  7   
  8   
  9   
 10   
 11   
 12   
 13   
 14   
 15   
 16   
 17  from buildbot import util 
 18  from buildbot.process.build import Build 
 19  from buildbot.process.buildstep import BuildStep 
 20  from buildbot.steps.source import CVS, SVN 
 21  from buildbot.steps.shell import Configure, Compile, Test, PerlModuleTest 
 22   
 23   
 24 -def s(steptype, **kwargs): 
  25       
 26       
 27      return (steptype, kwargs) 
  28   
 30      """When calling BuildFactory.addStep(stepinstance), addStep() only takes 
 31      one argument. You passed extra arguments to addStep(), which you probably 
 32      intended to pass to your BuildStep constructor instead. For example, you 
 33      should do:: 
 34   
 35       f.addStep(ShellCommand(command=['echo','stuff'], haltOnFailure=True)) 
 36   
 37      instead of:: 
 38   
 39       f.addStep(ShellCommand(command=['echo','stuff']), haltOnFailure=True) 
 40      """ 
  41   
 43      """ 
 44      @cvar  buildClass: class to use when creating builds 
 45      @type  buildClass: L{buildbot.process.build.Build} 
 46      """ 
 47      buildClass = Build 
 48      useProgress = 1 
 49      workdir = "build" 
 50      compare_attrs = ['buildClass', 'steps', 'useProgress', 'workdir'] 
 51   
 56   
 61   
 73   
 74 -    def addStep(self, step_or_factory, **kwargs): 
  85   
  89   
 90   
 91   
 93 -    def __init__(self, source, configure="./configure", 
 94                   configureEnv={}, 
 95                   configureFlags=[], 
 96                   compile=["make", "all"], 
 97                   test=["make", "check"]): 
  117   
118 -class CPAN(BuildFactory): 
 119 -    def __init__(self, source, perl="perl"): 
  124   
126 -    def __init__(self, source, python="python", test=None): 
  131   
132 -class Trial(BuildFactory): 
 133      """Build a python module that uses distutils and trial. Set 'tests' to 
134      the module in which the tests can be found, or set useTestCaseNames=True 
135      to always have trial figure out which tests to run (based upon which 
136      files have been changed). 
137   
138      See docs/factories.xhtml for usage samples. Not all of the Trial 
139      BuildStep options are available here, only the most commonly used ones. 
140      To get complete access, you will need to create a custom 
141      BuildFactory.""" 
142   
143      trial = "trial" 
144      randomly = False 
145      recurse = False 
146   
147 -    def __init__(self, source, 
148                   buildpython=["python"], trialpython=[], trial=None, 
149                   testpath=".", randomly=None, recurse=None, 
150                   tests=None,  useTestCaseNames=False, env=None): 
 151          BuildFactory.__init__(self, [source]) 
152          assert tests or useTestCaseNames, "must use one or the other" 
153          if trial is not None: 
154              self.trial = trial 
155          if randomly is not None: 
156              self.randomly = randomly 
157          if recurse is not None: 
158              self.recurse = recurse 
159   
160          from buildbot.steps.python_twisted import Trial 
161          buildcommand = buildpython + ["./setup.py", "build"] 
162          self.addStep(Compile, command=buildcommand, env=env) 
163          self.addStep(Trial, 
164                       python=trialpython, trial=self.trial, 
165                       testpath=testpath, 
166                       tests=tests, testChanges=useTestCaseNames, 
167                       randomly=self.randomly, 
168                       recurse=self.recurse, 
169                       env=env, 
170                       ) 
  171   
172   
173   
174   
175   
176   
177  ConfigurableBuildFactory = BuildFactory 
178   
180       
181   
182 -    def __init__(self, cvsroot, cvsmodule, 
183                   configure=None, configureEnv={}, 
184                   compile="make all", 
185                   test="make check", cvsCopy=False): 
  194   
196      useProgress = False 
197   
198 -    def __init__(self, cvsroot, cvsmodule, 
199                   configure=None, configureEnv={}, 
200                   compile="make all", 
201                   test="make check", cvsCopy=False): 
  208   
210   
211 -    def __init__(self, svnurl, 
212                   configure=None, configureEnv={}, 
213                   compile="make all", 
214                   test="make check"): 
  220