Skip to content

Commit 78fe528

Browse files
committed
do more cross-testing
1 parent 8306073 commit 78fe528

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ env:
2121
- RUST_BACKTRACE=1
2222

2323
before_script:
24-
# Linux: install extra stuff for cross-compilation
25-
- if [[ "$TRAVIS_OS_NAME" == linux ]]; then sudo apt update && sudo apt install gcc-multilib; fi
2624
# Compute the rust version we use. We do not use "language: rust" to have more control here.
2725
- |
2826
if [[ "$TRAVIS_EVENT_TYPE" == cron ]]; then

travis.sh

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
set -euo pipefail
33

44
# Determine configuration
5-
if [ "$TRAVIS_OS_NAME" == linux ]; then
6-
FOREIGN_TARGET=i686-unknown-linux-gnu
7-
fi
85
export CARGO_EXTRA_FLAGS="--all-features"
96
export RUSTC_EXTRA_FLAGS="-D warnings"
107

@@ -16,19 +13,29 @@ echo
1613

1714
# Test
1815
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
2025
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
2432
}
2533

26-
echo "Test host architecture"
34+
# host
2735
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
3441
fi

0 commit comments

Comments
 (0)