[zorg] r224163 - Added buildfactory for ABI test-suite builder.

Galina Kistanova gkistanova at gmail.com
Fri Dec 12 14:56:29 PST 2014


Author: gkistanova
Date: Fri Dec 12 16:56:29 2014
New Revision: 224163

URL: http://llvm.org/viewvc/llvm-project?rev=224163&view=rev
Log:
Added buildfactory for ABI test-suite builder.

Added:
    zorg/trunk/zorg/buildbot/builders/ABITestsuitBuilder.py

Added: zorg/trunk/zorg/buildbot/builders/ABITestsuitBuilder.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/ABITestsuitBuilder.py?rev=224163&view=auto
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/ABITestsuitBuilder.py (added)
+++ zorg/trunk/zorg/buildbot/builders/ABITestsuitBuilder.py Fri Dec 12 16:56:29 2014
@@ -0,0 +1,66 @@
+from buildbot.process.properties import WithProperties
+from buildbot.steps.source       import SVN
+
+from zorg.buildbot.builders                import ClangBuilder
+from zorg.buildbot.commands.LitTestCommand import LitTestCommand
+
+
+def getABITestsuitBuildFactory(
+            always_clean=True,
+            test=True,
+            cmake='cmake',
+            extra_cmake_args=[], # Extra CMake args for all stages.
+            jobs=None,
+
+            env={}, # Environmental variables for all steps.
+
+            stage1_config='Release',
+            stage2_config='Release'):
+
+    # Prepare environmental variables. Set here all env we want for all steps.
+    merged_env = {
+        'TERM' : 'dumb' # Make sure Clang doesn't use color escape sequences.
+        }
+    if env is not None:
+        # Overwrite pre-set items with the given ones, so user can set anything.
+        merged_env.update(env)
+
+    stage2_build='stage2' # Should match the one defined in getClangCMakeBuildFactory.
+
+    # Bootstrap clang first.
+    f = ClangBuilder.getClangCMakeBuildFactory(
+            clean=always_clean,
+            test=test,
+            cmake=cmake,
+            extra_cmake_args=extra_cmake_args,
+            jobs=jobs,
+            env=merged_env,
+            useTwoStage=True,
+            stage1_config=stage1_config,
+            stage2_config=stage2_config)
+
+    # Checkout the test-suite.
+    f.addStep(SVN(name='svn-test-suite',
+                  mode='update', baseURL='http://llvm.org/svn/llvm-project/test-suite/',
+                  defaultBranch='trunk',
+                  workdir='test-suite'))
+
+    # Run the ABI test.
+    abi_test_env = {
+        'PYTHONPATH' : "llvm/utils/lit:${PYTHONPATH}",
+        'PATH'       : WithProperties("%(workdir)s/" + stage2_build + "/bin:${PATH}"),
+        }
+    merged_env.update(abi_test_env)
+
+    abi_test_cmd = ["python", "linux-x86.py", "clang", "test", "-v"]
+    if jobs:
+        abi_test_cmd.append("-j"+str(jobs))
+
+    f.addStep(LitTestCommand(name='abi-test-suite',
+                             command=abi_test_cmd,
+                             description=["running", "ABI", "test-suite"],
+                             descriptionDone=["ABI", "test-suite", "completed"],
+                             workdir='test-suite/ABI-Testsuite',
+                             env=merged_env))
+
+    return f





More information about the llvm-commits mailing list