]> git.lizzy.rs Git - rust.git/blob - travis.sh
expand explanation of how we treat validity invariants
[rust.git] / travis.sh
1 #!/bin/bash
2 set -euo pipefail
3
4 # Determine configuration
5 if [ "$TRAVIS_OS_NAME" == osx ]; then
6   MIRI_SYSROOT_BASE=~/Library/Caches/miri.miri.miri/
7   FOREIGN_TARGET=i686-apple-darwin
8 else
9   MIRI_SYSROOT_BASE=~/.cache/miri/
10   FOREIGN_TARGET=i686-unknown-linux-gnu
11 fi
12
13 # Prepare
14 echo "Build and install miri"
15 cargo build --release --all-features --all-targets
16 cargo install --all-features --force --path .
17 echo
18
19 echo "Get ourselves a MIR-full libstd for the host and a foreign architecture"
20 cargo miri setup
21 cargo miri setup --target "$FOREIGN_TARGET"
22 echo
23
24 # Test
25 function run_tests {
26   cargo test --release --all-features
27   test-cargo-miri/run-test.py
28 }
29
30 echo "Test host architecture"
31 export MIRI_SYSROOT="$MIRI_SYSROOT_BASE"/HOST
32 run_tests
33 echo
34
35 echo "Test foreign architecture ($FOREIGN_TARGET)"
36 export MIRI_SYSROOT="$MIRI_SYSROOT_BASE" MIRI_TEST_TARGET="$FOREIGN_TARGET"
37 run_tests
38 echo