def multiProveStep(pm_file): test_pat=re.sub('^nlw/lib/', 't/', re.sub('\.pm$', '*.t', pm_file)) return s(PrvShellCommand, workdir='build/nlw', description="tests for %s" % pm_file, command='''perl -e 'for (glob "%s") { $fails += system "prove -lv $_" } exit $fails' ''' % test_pat)
def __init__(self, repo, steps=None): self.basicSteps = [ # Checkout s( SocialtextSVN , mode='update' , baseURL=repo , defaultBranch='/trunk' ), # Fix tarball (harmless on nonMacs) nlwShellStep( 'fix help tarball' , 'dev-bin/fix-help-tarball-for-mac' ), # Stop test servers; clear cached fixtures. nlwShellStep( 'cleanup' , 'if [ -d t/tmp ]; then dev-bin/nlwctl -t stop; rm -r t/tmp*; fi' ), # Configure. nlwShellStep( 'configure' , './configure --dev=1 --apache-proxy=1 [email protected]' )] BuildFactory.__init__(self, self.basicSteps + steps)
def proveStep(test): path='t/%s.t' % test return s(PrvShellCommand, workdir='build/nlw', description="test: %s" % test, command='if [ -e %s ]; then prove -lv %s; else true; fi' % (path, path))
def test_s(self): """ L{s} is deprecated, but pass keyword arguments to the first argument, to construct a step. """ stepFactory = s(BuildStep, name='test') self.assertEqual(stepFactory, _BuildStepFactory(BuildStep, name='test')) warnings = self.flushWarnings([self.test_s]) self.assertEqual(len(warnings), 1) self.assertEqual(warnings[0]['category'], DeprecationWarning)
def test_init_deprecated(self): factory = BuildFactory([s(BuildStep)]) self.assertEqual(factory.steps, [(BuildStep, {})])
# enough. pypyc = "pypy/goal/pypy-c" self.buildModules(pypyc, projects) class TwistedIronPythonBuildFactory(FullTwistedBuildFactory): def __init__(self, source, *a, **kw): FullTwistedBuildFactory.__init__(self, source, ["ipy"], buildExtensions=False, *a, **kw) pyOpenSSLSource = s(Bzr, baseURL="http://bazaar.launchpad.net/~exarkun/pyopenssl/", defaultBranch="trunk", mode="copy") class PyOpenSSLBuildFactoryBase(BuildFactory): """ Build and test PyOpenSSL. """ def __init__(self, pyVersion, useTrial=True): BuildFactory.__init__(self, [pyOpenSSLSource]) self.uploadBase = 'build_products/' self.useTrial = useTrial self.learnVersion(pyVersion) def learnVersion(self, pyVersion): self.addStep(
# Don't try building these yet. PyPy doesn't quite work well # enough. pypyc = "pypy/goal/pypy-c" self.buildModules(pypyc, projects) class TwistedIronPythonBuildFactory(FullTwistedBuildFactory): def __init__(self, source, *a, **kw): FullTwistedBuildFactory.__init__( self, source, ["ipy"], buildExtensions=False, *a, **kw) pyOpenSSLSource = s( Bzr, baseURL="http://bazaar.launchpad.net/~exarkun/pyopenssl/", defaultBranch="trunk", mode="copy") class PyOpenSSLBuildFactoryBase(BuildFactory): """ Build and test PyOpenSSL. """ def __init__(self, pyVersion, useTrial=True): BuildFactory.__init__(self, [pyOpenSSLSource]) self.uploadBase = 'build_products/' self.useTrial = useTrial self.learnVersion(pyVersion)
def nlwShellStep(name, command): return s(PrvShellCommand, workdir='build/nlw', description=name, command=command)