]> git.lizzy.rs Git - rust.git/commitdiff
mk: Add configure option for disabling codegen tests
authorAlex Crichton <alex@alexcrichton.com>
Thu, 10 Mar 2016 03:11:02 +0000 (19:11 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Sun, 3 Apr 2016 07:18:44 +0000 (00:18 -0700)
Our `codegen` test suite requires the LLVM `FileCheck` utility but unfortunately
this isn't always available in all custom LLVM roots (e.g. those specified via
`--llvm-root`). This commit adds a `./configure` option called
`--disable-codegen-tests` which will manually disable running these tests. In
the case that this option is passed we can forgo the need for the `FileCheck`
executable. Note that we still require `FileCheck` by default as we will attempt
to run these tests.

Closes #28667

configure
mk/tests.mk

index 2a18beeb8c9542032f9dff7ab967c6c49a8c8025..da5468a0ce61dbc6657c1f727c2d1351704a4864 100755 (executable)
--- a/configure
+++ b/configure
@@ -608,6 +608,7 @@ opt inject-std-version 1 "inject the current compiler version of libstd into pro
 opt llvm-version-check 1 "check if the LLVM version is supported, build anyway"
 opt rustbuild 0 "use the rust and cargo based build system"
 opt orbit 0 "get MIR where it belongs - everywhere; most importantly, in orbit"
+opt codegen-tests 1 "run the src/test/codegen tests"
 
 # Optimization and debugging options. These may be overridden by the release channel, etc.
 opt_nosave optimize 1 "build optimized rust code"
@@ -1497,7 +1498,9 @@ do
         LLVM_INST_DIR=$CFG_LLVM_ROOT
         do_reconfigure=0
         # Check that LLVm FileCheck is available. Needed for the tests
-        need_cmd $LLVM_INST_DIR/bin/FileCheck
+        if [ -z "$CFG_DISABLE_CODEGEN_TESTS" ]; then
+            need_cmd $LLVM_INST_DIR/bin/FileCheck
+        fi
     fi
 
     if [ ${do_reconfigure} -ne 0 ]
index 50c060c270a36420169d66c5d3da4e135c0cca0c..1a02b5c228104dd4d6e2db4058712fdd91fe53c5 100644 (file)
@@ -305,11 +305,15 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
        check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec \
        check-stage$(1)-T-$(2)-H-$(3)-debuginfo-gdb-exec \
        check-stage$(1)-T-$(2)-H-$(3)-debuginfo-lldb-exec \
-       check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
-       check-stage$(1)-T-$(2)-H-$(3)-codegen-units-exec \
        check-stage$(1)-T-$(2)-H-$(3)-doc-exec \
        check-stage$(1)-T-$(2)-H-$(3)-pretty-exec
 
+ifndef CFG_DISABLE_CODEGEN_TESTS
+check-stage$(1)-T-$(2)-H-$(3)-exec: \
+       check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
+       check-stage$(1)-T-$(2)-H-$(3)-codegen-units-exec
+endif
+
 # Only test the compiler-dependent crates when the target is
 # able to build a compiler (when the target triple is in the set of host triples)
 ifneq ($$(findstring $(2),$$(CFG_HOST)),)