do more cross-testing

This commit is contained in:
Ralf Jung 2020-03-21 23:17:18 +01:00
parent 8306073835
commit 78fe5288d0
2 changed files with 21 additions and 16 deletions

View file

@ -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

View file

@ -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