diff --git a/.travis.yml b/.travis.yml index 3f0ca8a016bd..137ae4fe6625 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,8 +21,6 @@ env: - RUST_BACKTRACE=1 before_script: -# Linux: install extra stuff for cross-compilation -- if [[ "$TRAVIS_OS_NAME" == linux ]]; then sudo apt update && sudo apt install gcc-multilib; fi # Compute the rust version we use. We do not use "language: rust" to have more control here. - | if [[ "$TRAVIS_EVENT_TYPE" == cron ]]; then diff --git a/travis.sh b/travis.sh index fec9145ab0f7..4988c0e76ff6 100755 --- a/travis.sh +++ b/travis.sh @@ -2,9 +2,6 @@ set -euo pipefail # Determine configuration -if [ "$TRAVIS_OS_NAME" == linux ]; then - FOREIGN_TARGET=i686-unknown-linux-gnu -fi export CARGO_EXTRA_FLAGS="--all-features" export RUSTC_EXTRA_FLAGS="-D warnings" @@ -16,19 +13,29 @@ echo # Test function run_tests { - ./miri test --locked + if [ -n "${FOREIGN_TARGET+exists}" ]; then + echo "Testing foreign architecture $FOREIGN_TARGET" + else + echo "Testing host architecture" + fi + + ./miri test --locked + if ! [ -n "${FOREIGN_TARGET+exists}" ]; then + # Only for host architecture: tests with MIR optimizations MIRI_TEST_FLAGS="-Z mir-opt-level=3" ./miri test - # "miri test" has built the sysroot for us, now this should pass without - # any interactive questions. - test-cargo-miri/run-test.py + 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 - -if [ -n "${FOREIGN_TARGET+exists}" ]; then - echo "Test foreign architecture ($FOREIGN_TARGET)" - MIRI_TEST_TARGET="$FOREIGN_TARGET" run_tests - echo +# cross-test 32bit Linux from everywhere +MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests +if [ "$TRAVIS_OS_NAME" == linux ]; then + # cross-test 64bit macOS from Linux + FOREIGN_TARGET=x86_64-apple-darwin run_tests fi