Exemplo n.º 1
0
def getFastNightlyTestBuildFactory(triple, xfails=[], clean=True, test=False, **kwargs):
  # Build compiler to test.  
  f = ClangBuilder.getClangBuildFactory(
    triple, outOfDir=True, clean=clean, test=test,
    **kwargs)

  # Prepare environmental variables. Set here all env we want everywhere.
  merged_env = {
                   'TERM' : 'dumb'     # Make sure Clang doesn't use color escape sequences.
               }
  env = kwargs.pop('env', None)
  if env is not None:
      merged_env.update(env)  # Overwrite pre-set items with the given ones, so user can set anything.

  # Get the test-suite sources.
  f.addStep(SVN(name          = 'svn-test-suite',
                mode          = 'update',
                baseURL       = 'http://llvm.org/svn/llvm-project/test-suite/',
                defaultBranch = 'trunk',
                workdir       = 'test-suite.src'))

  # Clean up.
  if clean:
      f.addStep(ShellCommand(name="rm.test-suite",
                             command=["rm", "-rf", "test-suite.obj"],
                             haltOnFailure = True,
                             description   = "rm test-suite build dir",
                             workdir       = ".",
                             env           = merged_env))

  # Configure.
  f.addStep(Configure(name="configure.test-suite",
                      command=['../test-suite.src/configure',
                               WithProperties("--with-llvmsrc=%(builddir)s/llvm.src"),
                               WithProperties("--with-llvmobj=%(builddir)s/llvm.obj"),
                               WithProperties("--with-built-clang")],
                      haltOnFailure   = True,
                      description     = ["configuring", "test-suite"],
                      descriptionDone = ["configure",   "test-suite"],
                      workdir         = 'test-suite.obj',
                      env             = merged_env))

  # Build and test.
  f.addStep(ShellCommand(name="rm.test-suite.report",
                         command=["rm", "-rf",
                                  "test-suite.obj/report.nightly.raw.out",
                                  "test-suite.obj/report.nightly.txt"],
                         haltOnFailure = True,
                         description   = "rm test-suite report",
                         workdir       = ".",
                         env           = merged_env))
  f.addStep(NightlyTestCommand(name="make.test-suite",
                               command=["make", WithProperties("-j%(jobs)s"),
                                        "ENABLE_PARALLEL_REPORT=1",
                                        "DISABLE_CBE=1", "DISABLE_JIT=1",
                                        "TEST=nightly", "report"],
                               haltOnFailure   = True,
                               logfiles        = { 'report' : 'report.nightly.txt' },
                               xfails          = xfails,
                               description     = ["running", "test-suite"],
                               descriptionDone = ["run",     "test-suite"],
                               workdir         = 'test-suite.obj',
                               env             = merged_env))

  return f
Exemplo n.º 2
0
def getKLEEBuildFactory(triple, jobs='%(jobs)d', llvm_branch='trunk',
                        config_name='Release+Asserts', clean=True, llvmgccdir=None,
                        *args, **kwargs):
    if False:
        f = buildbot.process.factory.BuildFactory()

        # Determine the build directory.
        f.addStep(buildbot.steps.shell.SetProperty(name="get_builddir",
                                                   command=["pwd"],
                                                   property="builddir",
                                                   description="set build dir",
                                                   workdir="."))
    else:
        # If we are building from trunk, we need to build Clang as
        # well so we have access to an LLVM capable compiler.
        if llvm_branch == 'trunk':
            f = ClangBuilder.getClangBuildFactory(triple, jobs=jobs,
                                                  stage1_config=config_name, extra_configure_args=['--with-built-clang',
                                                                                                   '--enable-targets=host',
                                                                                                   '--with-llvmcc=clang'],
                                                  clean=clean, test=False, *args, **kwargs)
        else:
            f = LLVMBuilder.getLLVMBuildFactory(triple, jobs=jobs, defaultBranch=llvm_branch,
                                                config_name=config_name, llvmgccdir=llvmgccdir,
                                                enable_targets='x86', clean=clean, test=False,
                                                *args, **kwargs)

    # Checkout sources.
    f.addStep(SVN(name='svn-klee',
                  mode='update', baseURL='http://llvm.org/svn/llvm-project/klee/',
                  defaultBranch='trunk', workdir='klee'))

    # Configure.
    configure_args = ["./configure", WithProperties("--with-llvm=%(builddir)s/llvm")]
    configure_args += getConfigArgs(config_name)
    if triple:
        configure_args += ['--build=%s' % triple,
                           '--host=%s' % triple,
                           '--target=%s' % triple]
    f.addStep(Configure(command=configure_args, workdir='klee',
                        description=['configure','klee',config_name]))

    # Clean, if requested.
    if clean:
        f.addStep(WarningCountingShellCommand(name="clean-klee",
                                              command=['make', 'clean'],
                                              haltOnFailure=True,
                                              description="clean klee",
                                              workdir='klee'))

    # Compile.
    f.addStep(WarningCountingShellCommand(name="compile",
                                          command=['nice', '-n', '10',
                                                   'make', WithProperties("-j%s" % jobs)],
                                          haltOnFailure=True, description="compile klee",
                                          workdir='klee'))

    # Test.
    f.addStep(DejaGNUCommand(name="test",
                             command=['nice', '-n', '10',
                                      'make', 'check'],
                             haltOnFailure=True, description="test klee",
                             workdir='klee',
                             logfiles={ 'dg.sum' : 'test/testrun.sum' }))

    return f
Exemplo n.º 3
0
def getFastNightlyTestBuildFactory(triple,
                                   xfails=[],
                                   clean=True,
                                   test=False,
                                   make='make',
                                   **kwargs):
    # Build compiler to test.
    f = ClangBuilder.getClangBuildFactory(triple,
                                          clean=clean,
                                          test=test,
                                          make=make,
                                          **kwargs)

    # Prepare environmental variables. Set here all env we want everywhere.
    merged_env = {
        'TERM': 'dumb'  # Make sure Clang doesn't use color escape sequences.
    }
    env = kwargs.pop('env', None)
    if env is not None:
        merged_env.update(
            env
        )  # Overwrite pre-set items with the given ones, so user can set anything.

    # Get the test-suite sources.
    f.addStep(
        SVN(name='svn-test-suite',
            mode='update',
            baseURL='http://llvm.org/svn/llvm-project/test-suite/',
            defaultBranch='trunk',
            workdir='test-suite.src'))

    # Clean up.
    if clean:
        f.addStep(
            ShellCommand(name="rm.test-suite",
                         command=["rm", "-rf", "test-suite.obj"],
                         haltOnFailure=True,
                         description="rm test-suite build dir",
                         workdir=".",
                         env=merged_env))

    # Configure.
    f.addStep(
        Configure(name="configure.test-suite",
                  command=[
                      '../test-suite.src/configure',
                      WithProperties("--with-llvmsrc=%(builddir)s/llvm.src"),
                      WithProperties("--with-llvmobj=%(builddir)s/llvm.obj"),
                      WithProperties("--with-built-clang")
                  ],
                  haltOnFailure=True,
                  description=["configuring", "test-suite"],
                  descriptionDone=["configure", "test-suite"],
                  workdir='test-suite.obj',
                  env=merged_env))

    # Build and test.
    f.addStep(
        ShellCommand(name="rm.test-suite.report",
                     command=[
                         "rm", "-rf", "test-suite.obj/report.nightly.raw.out",
                         "test-suite.obj/report.nightly.txt"
                     ],
                     haltOnFailure=True,
                     description="rm test-suite report",
                     workdir=".",
                     env=merged_env))
    f.addStep(
        NightlyTestCommand(name="make.test-suite",
                           command=[
                               make,
                               WithProperties("-j%(jobs)s"),
                               "ENABLE_PARALLEL_REPORT=1", "DISABLE_CBE=1",
                               "DISABLE_JIT=1", "TEST=nightly", "report"
                           ],
                           haltOnFailure=True,
                           logfiles={'report': 'report.nightly.txt'},
                           xfails=xfails,
                           description=["running", "test-suite"],
                           descriptionDone=["run", "test-suite"],
                           workdir='test-suite.obj',
                           env=merged_env))

    return f