[llvm-commits] [zorg] r151351 - /zorg/trunk/zorg/buildbot/builders/DragonEggBuilder.py

Duncan Sands baldrick at free.fr
Thu Feb 23 23:27:38 PST 2012


Author: baldrick
Date: Fri Feb 24 01:27:38 2012
New Revision: 151351

URL: http://llvm.org/viewvc/llvm-project?rev=151351&view=rev
Log:
Builder for running the nightly testsuite using dragonegg.

Modified:
    zorg/trunk/zorg/buildbot/builders/DragonEggBuilder.py

Modified: zorg/trunk/zorg/buildbot/builders/DragonEggBuilder.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/DragonEggBuilder.py?rev=151351&r1=151350&r2=151351&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/DragonEggBuilder.py (original)
+++ zorg/trunk/zorg/buildbot/builders/DragonEggBuilder.py Fri Feb 24 01:27:38 2012
@@ -4,6 +4,7 @@
 from buildbot.steps.shell import Configure, ShellCommand
 from buildbot.steps.shell import WarningCountingShellCommand
 from buildbot.process.properties import WithProperties
+from zorg.buildbot.commands.NightlyTestCommand import NightlyTestCommand
 
 def getCCSetting(gcc, gxx):
   cc_settings = []
@@ -221,3 +222,148 @@
                            workdir='dragonegg.obj.stage3', env=cur_env))
 
     return f
+
+
+def getDragonEggNightlyTestBuildFactory(gcc, gxx, llvm_configure_args=[],
+                                        xfails=[], clean=True, env={},
+                                        jobs='%(jobs)s', timeout=20):
+    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='.', env=env))
+
+    # Checkout LLVM sources.
+    llvm_src_dir = 'llvm.src'
+    f.addStep(SVN(name='svn-llvm', mode='update',
+                  baseURL='http://llvm.org/svn/llvm-project/llvm/',
+                  defaultBranch='trunk', workdir=llvm_src_dir, env=env))
+
+    # Checkout DragonEgg sources.
+    dragonegg_src_dir = 'dragonegg.src'
+    f.addStep(SVN(name='svn-dragonegg', mode='update',
+                  baseURL='http://llvm.org/svn/llvm-project/dragonegg/',
+                  defaultBranch='trunk', workdir=dragonegg_src_dir, env=env))
+
+    # Checkout the test-suite sources.
+    testsuite_src_dir = 'test-suite.src'
+    f.addStep(SVN(name='svn-test-suite', mode='update',
+                  baseURL='http://llvm.org/svn/llvm-project/test-suite/',
+                  defaultBranch='trunk', workdir=testsuite_src_dir, env=env))
+
+    # Build and install LLVM.
+    llvm_obj_dir = 'llvm.obj'
+    llvm_install_dir = 'llvm.install'
+    if clean:
+        f.addStep(ShellCommand(name='rm-%s' % llvm_obj_dir,
+                               command=['rm', '-rf', llvm_obj_dir,
+                                        llvm_install_dir],
+                               description='rm build dir llvm',
+                               haltOnFailure=True, workdir='.', env=env))
+    f.addStep(Configure(name='configure.llvm',
+                        command=(['../' + llvm_src_dir + '/configure',
+                                  WithProperties('--prefix=%%(builddir)s/%s' % llvm_install_dir)] +
+                                 llvm_configure_args),
+                        description='configuring llvm',
+                        descriptionDone='configure llvm',
+                        haltOnFailure=True, workdir=llvm_obj_dir, env=env))
+    f.addStep(WarningCountingShellCommand(name='compile.llvm',
+                                          command=['nice', '-n', '10',
+                                                   'make', WithProperties('-j%s' % jobs)],
+                                          haltOnFailure=True,
+                                          description='compiling llvm',
+                                          descriptionDone='compile llvm',
+                                          workdir=llvm_obj_dir, env=env,
+                                          timeout=timeout*60))
+    f.addStep(WarningCountingShellCommand(name='install.llvm',
+                                          command=['nice', '-n', '10',
+                                                   'make', 'install'],
+                                          haltOnFailure=True,
+                                          description='installing llvm',
+                                          descriptionDone='install llvm',
+                                          workdir=llvm_obj_dir, env=env))
+
+    # Build dragonegg with the just built LLVM.
+    dragonegg_obj_dir = 'dragonegg.obj'
+    if clean:
+        f.addStep(ShellCommand(name='rm-%s' % dragonegg_obj_dir,
+                               command=['rm', '-rf', dragonegg_obj_dir],
+                               description='rm build dir dragonegg',
+                               haltOnFailure=True, workdir='.', env=env))
+    f.addStep(WarningCountingShellCommand(
+            name='compile.dragonegg',
+            command=['nice', '-n', '10',
+                     'make', '-f', '../' + dragonegg_src_dir + '/Makefile',
+                     WithProperties('-j%s' % jobs),
+                     WithProperties('GCC=' + gcc),
+                     WithProperties('LLVM_CONFIG=%(builddir)s/' +
+                                    llvm_install_dir + '/bin/llvm-config'),
+                     WithProperties('TOP_DIR=%(builddir)s/' + dragonegg_src_dir)
+                     ],
+            haltOnFailure=True,
+            description='compiling dragonegg',
+            descriptionDone='compile dragonegg',
+            workdir=dragonegg_obj_dir, env=env, timeout=timeout*60))
+
+    # Pretend that DragonEgg is llvm-gcc by creating llvm-gcc and llvm-g++
+    # scripts that dispatch to gcc with dragonegg and g++ with dragonegg.
+    if clean:
+        f.addStep(ShellCommand(name='rm-bin',
+                               command=['rm', '-rf', 'bin'],
+                               description='rm bin dir',
+                               haltOnFailure=True, workdir='.', env=env))
+    f.addStep(ShellCommand(name='create.llvm-gcc.script',
+                           command=WithProperties('echo "#!/bin/sh" > llvm-gcc'
+                             '; echo "exec ' + gcc + ' -fplugin=%(builddir)s/' +
+                             dragonegg_obj_dir + '/dragonegg.so \\"\$@\\"" >> llvm-gcc'
+                             '; chmod a+x llvm-gcc'),
+                           description='create llvm-gcc script',
+                           haltOnFailure=True, workdir='bin', env=env))
+    f.addStep(ShellCommand(name='create.llvm-g++.script',
+                           command=WithProperties('echo "#!/bin/sh" > llvm-g++'
+                             '; echo "exec ' + gxx + ' -fplugin=%(builddir)s/' +
+                             dragonegg_obj_dir + '/dragonegg.so \\"\$@\\"" >> llvm-g++'
+                             '; chmod a+x llvm-g++'),
+                           description='create llvm-g++ script',
+                           haltOnFailure=True, workdir='bin', env=env))
+
+    # Configure the test-suite.
+    testsuite_obj_dir = 'test-suite.obj'
+    if clean:
+        f.addStep(ShellCommand(name='rm-%s' % testsuite_obj_dir,
+                               command=['rm', '-rf', testsuite_obj_dir],
+                               description='rm test-suite build dir',
+                               haltOnFailure=True, workdir='.', env=env))
+    f.addStep(Configure(name='configure.test-suite',
+                        command=['../' + testsuite_src_dir + '/configure',
+                                 WithProperties('--with-llvmsrc=%(builddir)s/' + llvm_src_dir),
+                                 WithProperties('--with-llvmobj=%(builddir)s/' + llvm_obj_dir),
+                                 WithProperties('--with-llvmgccdir=%(builddir)s/'),
+                                 '--with-llvmcc=llvm-gcc', 'CC=' + gcc, 'CXX=' + gxx],
+                        description='configuring test-suite',
+                        descriptionDone='configure test-suite',
+                        haltOnFailure=True, workdir=testsuite_obj_dir, env=env))
+
+    # Build and test.
+    f.addStep(ShellCommand(name='rm.test-suite.report',
+                           command=['rm', '-rf', testsuite_obj_dir + '/report',
+                                    testsuite_obj_dir + '/report.nightly.raw.out',
+                                    testsuite_obj_dir + '/report.nightly.txt'],
+                           description='rm test-suite report',
+                           haltOnFailure=True, workdir='.', env=env))
+    f.addStep(NightlyTestCommand(name='make.test-suite',
+                                 command=['make', WithProperties('-j%s' % jobs),
+                                          'ENABLE_PARALLEL_REPORT=1',
+                                          'DISABLE_CBE=1', 'DISABLE_JIT=1',
+                                          'TEST=nightly', 'report'],
+                                 logfiles={'report' : 'report.nightly.txt'},
+                                 description='running test-suite',
+                                 descriptionDone='run test-suite',
+                                 haltOnFailure=True, xfails=xfails,
+                                 timeout=timeout*60,
+                                 workdir=testsuite_obj_dir, env=env))
+
+    return f





More information about the llvm-commits mailing list