]> git.lizzy.rs Git - rust.git/blobdiff - ci.sh
Auto merge of #1636 - RalfJung:rustup, r=oli-obk
[rust.git] / ci.sh
diff --git a/ci.sh b/ci.sh
index 12683a2fccbec7c5bb9f2515ef7142789da24bc4..17bc8df83e182eacab02b1ec63d16fb1177fbf5a 100755 (executable)
--- a/ci.sh
+++ b/ci.sh
@@ -23,32 +23,43 @@ function run_tests {
   fi
 
   ./miri test --locked
-  if ! [ -n "${MIRI_TEST_TARGET+exists}" ]; then
+  if [ -z "${MIRI_TEST_TARGET+exists}" ]; then
     # Only for host architecture: tests with MIR optimizations
-    # FIXME: only testing level 2 because of <https://github.com/rust-lang/rust/issues/76432>.
-    MIRIFLAGS="-Z mir-opt-level=2" ./miri test --locked
+    MIRIFLAGS="-Z mir-opt-level=3" ./miri test --locked
   fi
+
+  # On Windows, there is always "python", not "python3" or "python2".
+  if command -v python3 > /dev/null; then
+    PYTHON=python3
+  else
+    PYTHON=python
+  fi
+
   # "miri test" has built the sysroot for us, now this should pass without
   # any interactive questions.
-  ${PYTHON:-python3} test-cargo-miri/run-test.py
-
+  ${PYTHON} test-cargo-miri/run-test.py
   echo
 }
 
 # host
 run_tests
 
-if [ "${TRAVIS_OS_NAME:-}" == linux ]; then
-  MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests
-  MIRI_TEST_TARGET=x86_64-apple-darwin run_tests
-  MIRI_TEST_TARGET=i686-pc-windows-msvc run_tests
-elif [ "${TRAVIS_OS_NAME:-}" == osx ]; then
-  MIRI_TEST_TARGET=mips64-unknown-linux-gnuabi64 run_tests # big-endian architecture
-  MIRI_TEST_TARGET=x86_64-pc-windows-msvc run_tests
-elif [ "${CI_WINDOWS:-}" == True ]; then
-  MIRI_TEST_TARGET=x86_64-unknown-linux-gnu run_tests
-  MIRI_TEST_TARGET=x86_64-apple-darwin run_tests
-else
-  echo "FATAL: unknown CI platform"
-  exit 1
-fi
+case $HOST_TARGET in
+  x86_64-unknown-linux-gnu)
+    MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests
+    MIRI_TEST_TARGET=x86_64-apple-darwin run_tests
+    MIRI_TEST_TARGET=i686-pc-windows-msvc run_tests
+    ;;
+  x86_64-apple-darwin)
+    MIRI_TEST_TARGET=mips64-unknown-linux-gnuabi64 run_tests # big-endian architecture
+    MIRI_TEST_TARGET=x86_64-pc-windows-msvc run_tests
+    ;;
+  i686-pc-windows-msvc)
+    MIRI_TEST_TARGET=x86_64-unknown-linux-gnu run_tests
+    MIRI_TEST_TARGET=x86_64-apple-darwin run_tests
+    ;;
+  *)
+    echo "FATAL: unknown OS"
+    exit 1
+    ;;
+esac