[zorg] r241972 - jenkins: Add an option to limit the number of lit jobs

Justin Bogner mail at justinbogner.com
Fri Jul 10 18:48:51 PDT 2015


Author: bogner
Date: Fri Jul 10 20:48:51 2015
New Revision: 241972

URL: http://llvm.org/viewvc/llvm-project?rev=241972&view=rev
Log:
jenkins: Add an option to limit the number of lit jobs

Modified:
    zorg/trunk/test/jenkins/test_build.py
    zorg/trunk/zorg/jenkins/build.py

Modified: zorg/trunk/test/jenkins/test_build.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/test/jenkins/test_build.py?rev=241972&r1=241971&r2=241972&view=diff
==============================================================================
--- zorg/trunk/test/jenkins/test_build.py (original)
+++ zorg/trunk/test/jenkins/test_build.py Fri Jul 10 20:48:51 2015
@@ -128,4 +128,8 @@
 # CHECK-CMAKE-PAR-LTO: '-DLLVM_PARALLEL_LINK_JOBS=2'
 # CHECK-CMAKE-PAR-LTO: '-DCMAKE_BUILD_TYPE=Release'
 
+# RUN: env MAX_PARALLEL_TESTS=2 python %{src_root}/zorg/jenkins/build.py cmake all | FileCheck --check-prefix CHECK-CMAKE-2-TESTS %s
+# CHECK-CMAKE-2-TESTS: '/usr/local/bin/cmake' '-G' 'Ninja'
+# CHECK-CMAKE-2-TESTS: '-DLLVM_LIT_ARGS=--xunit-xml-output=testresults.xunit.xml -v -j 2'
+
 # RUN: python %{src_root}/zorg/jenkins/build.py cmake all --cmake-type=RelWithDebugInfo

Modified: zorg/trunk/zorg/jenkins/build.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/build.py?rev=241972&r1=241971&r2=241972&view=diff
==============================================================================
--- zorg/trunk/zorg/jenkins/build.py (original)
+++ zorg/trunk/zorg/jenkins/build.py Fri Jul 10 20:48:51 2015
@@ -51,6 +51,7 @@ class Configuration(object):
         self._lldb_build_dir = os.environ.get('LLDB_BUILD_DIR', 'lldb-build')
         self._install_dir = os.environ.get('BUILD_DIR', 'clang-install')
         self.j_level = os.environ.get('J_LEVEL', None)
+        self.max_parallel_tests = os.environ.get('MAX_PARALLEL_TESTS', None)
         self.max_parallel_links = os.environ.get('MAX_PARALLEL_LINKS', None)
         self.host_compiler_url = os.environ.get('HOST_URL',
             'http://labmaster2.local/artifacts/')
@@ -157,8 +158,10 @@ def cmake_builder(target):
     else:
         cmake_cmd += ["-DLLVM_ENABLE_ASSERTIONS=Off"]
 
-    cmake_cmd += [
-        '-DLLVM_LIT_ARGS=--xunit-xml-output=testresults.xunit.xml -v']
+    lit_flags = ['--xunit-xml-output=testresults.xunit.xml', '-v']
+    if conf.max_parallel_tests:
+        lit_flags += ['-j', conf.max_parallel_tests]
+    cmake_cmd += ['-DLLVM_LIT_ARGS={}'.format(' '.join(lit_flags))]
 
     ninja_cmd = env + ["/usr/local/bin/ninja"]
     if conf.j_level is not None:





More information about the llvm-commits mailing list