]> git.lizzy.rs Git - rust.git/blob - travis.sh
Update a comment in README about what concurrency checks we support.
[rust.git] / travis.sh
1 #!/bin/bash
2 set -euo pipefail
3
4 # Determine configuration
5 export CARGO_EXTRA_FLAGS="--all-features"
6 export RUSTC_EXTRA_FLAGS="-D warnings"
7
8 # Prepare
9 echo "Build and install miri"
10 ./miri build --all-targets --locked
11 ./miri install # implicitly locked
12 echo
13
14 # Test
15 function run_tests {
16   if [ -n "${MIRI_TEST_TARGET+exists}" ]; then
17     echo "Testing foreign architecture $MIRI_TEST_TARGET"
18   else
19     echo "Testing host architecture"
20   fi
21
22   ./miri test --locked
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
26   fi
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
30
31   echo
32 }
33
34 # host
35 run_tests
36 # cross-test 32bit Linux from everywhere
37 MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests
38
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
49 fi