[zorg] r279795 - Fixups to custom build and test targets

Chris Matthews via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 25 17:17:10 PDT 2016


Author: cmatthews
Date: Thu Aug 25 19:17:10 2016
New Revision: 279795

URL: http://llvm.org/viewvc/llvm-project?rev=279795&view=rev
Log:
Fixups to custom build and test targets

Extra targets were being run, because the default lists were being
appeneded to. Also make -v on ninja universal.

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=279795&r1=279794&r2=279795&view=diff
==============================================================================
--- zorg/trunk/test/jenkins/test_build.py (original)
+++ zorg/trunk/test/jenkins/test_build.py Thu Aug 25 19:17:10 2016
@@ -85,8 +85,8 @@
 # CHECK-CMAKE: '-DCMAKE_BUILD_TYPE=Debug'
 # CHECK-CMAKE: '-DLLVM_ENABLE_ASSERTIONS=Off'
 # CHECK-CMAKE: -DLLVM_LIT_ARGS=--xunit-xml-output=testresults.xunit.xml -v
-# CHECK-CMAKE: '/usr/local/bin/ninja'
-# CHECK-CMAKE: '/usr/local/bin/ninja' '-k' '0' '-v' 'check' 'check-clang' 'check-all'
+# CHECK-CMAKE: '/usr/local/bin/ninja' '-v' 'all'
+# CHECK-CMAKE: '/usr/local/bin/ninja' '-v' '-k' '0' 'check-all'
 
 
 # RUN: python %{src_root}/zorg/jenkins/build.py cmake build
@@ -160,8 +160,14 @@
 # RUN: python %{src_root}/zorg/jenkins/build.py clang all --lto --cmake-flag="-DFOO" | FileCheck --check-prefix CHECK-CMAKEFLAGS %s
 # CHECK-CMAKEFLAGS: '-DFOO'
 
-# RUN: python %{src_root}/zorg/jenkins/build.py cmake all --cmake-build-target foo --cmake-build-target bar | FileCheck --check-prefix CHECK-BTARGETS %s
-# CHECK-BTARGETS: 'foo' 'bar'
-
-# RUN: python %{src_root}/zorg/jenkins/build.py cmake all --cmake-test-target foo --cmake-test-target bar | FileCheck --check-prefix CHECK-TTARGETS %s
-# CHECK-TTARGETS: 'foo' 'bar'
+# Make sure you can pass new build targetss.
+# RUN: python %{src_root}/zorg/jenkins/build.py cmake  build --cmake-build-target foo --cmake-build-target bar | FileCheck --check-prefix CHECK-BTARGETS %s
+# CHECK-BTARGETS: '/usr/local/bin/ninja' '-v' 'foo' 'bar'
+
+# Make sure you can pass new test targets.
+# RUN: python %{src_root}/zorg/jenkins/build.py cmake test --cmake-test-target foo --cmake-test-target bar | FileCheck --check-prefix CHECK-TTARGETS %s
+# CHECK-TTARGETS: '/usr/local/bin/ninja' '-v' '-k' '0' 'foo' 'bar'
+
+# Test long should always do check-all, since that is what many bots expect.
+# RUN: python %{src_root}/zorg/jenkins/build.py cmake testlong  | FileCheck --check-prefix CHECK-TTARGETS2 %s
+# CHECK-TTARGETS2: '/usr/local/bin/ninja' '-v' '-k' '0' 'check-all'
\ No newline at end of file

Modified: zorg/trunk/zorg/jenkins/build.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/build.py?rev=279795&r1=279794&r2=279795&view=diff
==============================================================================
--- zorg/trunk/zorg/jenkins/build.py (original)
+++ zorg/trunk/zorg/jenkins/build.py Thu Aug 25 19:17:10 2016
@@ -237,7 +237,7 @@ def cmake_builder(target):
         lit_flags += ['-j', conf.max_parallel_tests]
     cmake_cmd += ['-DLLVM_LIT_ARGS={}'.format(' '.join(lit_flags))]
 
-    ninja_cmd = env + ["/usr/local/bin/ninja"]
+    ninja_cmd = env + ["/usr/local/bin/ninja", '-v']
     if conf.j_level is not None:
         ninja_cmd += ["-j", conf.j_level]
 
@@ -246,17 +246,28 @@ def cmake_builder(target):
         run_cmd(conf.builddir(), cmake_cmd)
         footer()
         header("Ninja build")
-        run_cmd(conf.builddir(), ninja_cmd)
+
+        # Build all if nothing is passed by the user.
+        passed_target = conf.cmake_build_targets
+        build_target = passed_target if passed_target else ['all']
+        run_cmd(conf.builddir(), ninja_cmd + build_target)
         header("Ninja install")
-        run_cmd(conf.builddir(), ninja_cmd + conf.cmake_build_targets)
+        run_cmd(conf.builddir(), ninja_cmd + ['install'])
         build_upload_artifact()
         footer()
     # Run all the test targets.
-    ninja_cmd.extend(['-k', '0', '-v'])
+    ninja_cmd.extend(['-k', '0'])
     if target == 'all' or target == 'test' or target == 'testlong':
         header("Ninja test")
-        long = ['check-all'] if target == 'testlong' or target == 'all' else []
-        run_cmd(conf.builddir(), ninja_cmd + conf.cmake_test_targets + long)
+
+        targets = ['check-all'] if target == 'testlong' or target == 'all' else conf.cmake_test_targets
+
+        if not targets:
+            # testlong and all do check all, otherwise check and check-clang
+            # unless the user asked for something else.
+            targets = ['check', 'check-clang']
+
+        run_cmd(conf.builddir(), ninja_cmd + targets)
         footer()
 
 
@@ -826,10 +837,10 @@ def parse_args():
                         action='append', default=[],
                         help='Set an arbitrary cmake flag')
     parser.add_argument('--cmake-test-target', dest='cmake_test_targets',
-                        action='append', default=['check', 'check-clang'],
+                        action='append', default=[],
                         help='Targets to build during testing')
     parser.add_argument('--cmake-build-target', dest='cmake_build_targets',
-                        action='append', default=['install'],
+                        action='append', default=[],
                         help='Targets to build during building.')
     parser.add_argument('--compiler-flag', dest='compiler_flags',
                         action='append', default=[],




More information about the llvm-commits mailing list