|
2 | 2 | set -euo pipefail
|
3 | 3 |
|
4 | 4 | # Determine configuration
|
5 |
| -if [ "$TRAVIS_OS_NAME" == linux ]; then |
6 |
| - FOREIGN_TARGET=i686-unknown-linux-gnu |
7 |
| -fi |
8 | 5 | export CARGO_EXTRA_FLAGS="--all-features"
|
9 | 6 | export RUSTC_EXTRA_FLAGS="-D warnings"
|
10 | 7 |
|
|
16 | 13 |
|
17 | 14 | # Test
|
18 | 15 | function run_tests {
|
19 |
| - ./miri test --locked |
| 16 | + if [ -n "${FOREIGN_TARGET+exists}" ]; then |
| 17 | + echo "Testing foreign architecture $FOREIGN_TARGET" |
| 18 | + else |
| 19 | + echo "Testing host architecture" |
| 20 | + fi |
| 21 | + |
| 22 | + ./miri test --locked |
| 23 | + if ! [ -n "${FOREIGN_TARGET+exists}" ]; then |
| 24 | + # Only for host architecture: tests with MIR optimizations |
20 | 25 | MIRI_TEST_FLAGS="-Z mir-opt-level=3" ./miri test
|
21 |
| - # "miri test" has built the sysroot for us, now this should pass without |
22 |
| - # any interactive questions. |
23 |
| - test-cargo-miri/run-test.py |
| 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 |
24 | 32 | }
|
25 | 33 |
|
26 |
| -echo "Test host architecture" |
| 34 | +# host |
27 | 35 | run_tests
|
28 |
| -echo |
29 |
| - |
30 |
| -if [ -n "${FOREIGN_TARGET+exists}" ]; then |
31 |
| - echo "Test foreign architecture ($FOREIGN_TARGET)" |
32 |
| - MIRI_TEST_TARGET="$FOREIGN_TARGET" run_tests |
33 |
| - echo |
| 36 | +# cross-test 32bit Linux from everywhere |
| 37 | +MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests |
| 38 | +if [ "$TRAVIS_OS_NAME" == linux ]; then |
| 39 | + # cross-test 64bit macOS from Linux |
| 40 | + FOREIGN_TARGET=x86_64-apple-darwin run_tests |
34 | 41 | fi
|
0 commit comments