]> git.lizzy.rs Git - rust.git/blobdiff - travis.sh
Auto merge of #1284 - vakaras:add-threads-cr2, r=RalfJung
[rust.git] / travis.sh
index af297129e821612260418ef098b597b6ad8e22e5..590b94b7f5db29e925ba65391607c92126cff69e 100755 (executable)
--- a/travis.sh
+++ b/travis.sh
@@ -2,11 +2,6 @@
 set -euo pipefail
 
 # Determine configuration
-if [ "$TRAVIS_OS_NAME" == osx ]; then
-  FOREIGN_TARGET=i686-apple-darwin
-else
-  FOREIGN_TARGET=i686-unknown-linux-gnu
-fi
 export CARGO_EXTRA_FLAGS="--all-features"
 export RUSTC_EXTRA_FLAGS="-D warnings"
 
@@ -18,16 +13,37 @@ echo
 
 # Test
 function run_tests {
-    ./miri test --locked
-    # "miri test" has built the sysroot for us, now this should pass without
-    # any interactive questions.
-    test-cargo-miri/run-test.py
+  if [ -n "${MIRI_TEST_TARGET+exists}" ]; then
+    echo "Testing foreign architecture $MIRI_TEST_TARGET"
+  else
+    echo "Testing host architecture"
+  fi
+
+  ./miri test --locked
+  if ! [ -n "${MIRI_TEST_TARGET+exists}" ]; then
+    # Only for host architecture: tests with MIR optimizations
+    MIRI_TEST_FLAGS="-Z mir-opt-level=3" ./miri test
+  fi
+  # "miri test" has built the sysroot for us, now this should pass without
+  # any interactive questions.
+  test-cargo-miri/run-test.py
+
+  echo
 }
 
-echo "Test host architecture"
+# host
 run_tests
-echo
+# cross-test 32bit Linux from everywhere
+MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests
 
-echo "Test foreign architecture ($FOREIGN_TARGET)"
-MIRI_TEST_TARGET="$FOREIGN_TARGET" run_tests
-echo
+if [ "$TRAVIS_OS_NAME" == linux ]; then
+  # cross-test 64bit macOS from Linux
+  MIRI_TEST_TARGET=x86_64-apple-darwin run_tests
+  # cross-test 32bit Windows from Linux
+  MIRI_TEST_TARGET=i686-pc-windows-msvc run_tests
+elif [ "$TRAVIS_OS_NAME" == osx ]; then
+  # cross-test 64bit Windows from macOS
+  MIRI_TEST_TARGET=x86_64-pc-windows-msvc run_tests
+  # cross-test 32bit GNU Windows from macOS
+  MIRI_TEST_TARGET=i686-pc-windows-gnu run_tests
+fi