rust/travis.sh

39 lines
889 B
Bash
Raw Normal View History

#!/bin/bash
2019-02-08 05:13:07 -06:00
set -euo pipefail
# Determine configuration
if [ "$TRAVIS_OS_NAME" == osx ]; then
MIRI_SYSROOT_BASE=~/Library/Caches/miri.miri.miri/
FOREIGN_TARGET=i686-apple-darwin
else
MIRI_SYSROOT_BASE=~/.cache/miri/
FOREIGN_TARGET=i686-unknown-linux-gnu
fi
# Prepare
2018-12-12 12:52:49 -06:00
echo "Build and install miri"
2018-12-15 07:13:46 -06:00
cargo build --release --all-features --all-targets
cargo install --all-features --force --path .
2018-12-12 12:52:49 -06:00
echo
2018-12-12 12:52:49 -06:00
echo "Get ourselves a MIR-full libstd for the host and a foreign architecture"
2018-12-15 07:13:46 -06:00
cargo miri setup
cargo miri setup --target "$FOREIGN_TARGET"
2018-12-12 12:52:49 -06:00
echo
# Test
function run_tests {
cargo test --release --all-features
test-cargo-miri/run-test.py
}
echo "Test host architecture"
export MIRI_SYSROOT="$MIRI_SYSROOT_BASE"/HOST
run_tests
2018-12-12 12:52:49 -06:00
echo
echo "Test foreign architecture ($FOREIGN_TARGET)"
export MIRI_SYSROOT="$MIRI_SYSROOT_BASE" MIRI_TEST_TARGET="$FOREIGN_TARGET"
run_tests
2018-12-12 12:52:49 -06:00
echo