4 # Determine configuration
5 export CARGO_EXTRA_FLAGS="--all-features"
6 export RUSTC_EXTRA_FLAGS="-D warnings"
9 echo "Build and install miri"
10 ./miri build --all-targets --locked
11 ./miri install # implicitly locked
16 if [ -n "${MIRI_TEST_TARGET+exists}" ]; then
17 echo "Testing foreign architecture $MIRI_TEST_TARGET"
19 echo "Testing host architecture"
23 if ! [ -n "${MIRI_TEST_TARGET+exists}" ]; then
24 # Only for host architecture: tests with MIR optimizations
25 MIRI_TEST_FLAGS="-Z mir-opt-level=3" ./miri test
27 # "miri test" has built the sysroot for us, now this should pass without
28 # any interactive questions.
29 test-cargo-miri/run-test.py
36 # cross-test 32bit Linux from everywhere
37 MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests
39 if [ "$TRAVIS_OS_NAME" == linux ]; then
40 # cross-test 64bit macOS from Linux
41 MIRI_TEST_TARGET=x86_64-apple-darwin run_tests
42 # cross-test 32bit Windows from Linux
43 MIRI_TEST_TARGET=i686-pc-windows-msvc run_tests
44 elif [ "$TRAVIS_OS_NAME" == osx ]; then
45 # cross-test 64bit Windows from macOS
46 MIRI_TEST_TARGET=x86_64-pc-windows-msvc run_tests
47 # cross-test 32bit GNU Windows from macOS
48 MIRI_TEST_TARGET=i686-pc-windows-gnu run_tests