3 # Cache the global cargo directory, but NOT the local `target` directory which
4 # we cannot reuse anyway when the nightly changes (and it grows quite large
14 # mac os weirdness (https://github.com/travis-ci/travis-ci/issues/6307)
16 # Compute the rust version we use. We do not use "language: rust" to have more control here.
18 if [ "$TRAVIS_EVENT_TYPE" = cron ]; then
19 RUST_TOOLCHAIN=nightly
21 RUST_TOOLCHAIN=$(cat rust-toolchain)
25 - curl https://build.travis-ci.org/files/rustup-init.sh -sSf | sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN"
26 - export PATH=$HOME/.cargo/bin:$PATH
28 # customize installation
29 - rustup target add i686-unknown-linux-gnu
30 - rustup target add i686-pc-windows-gnu
31 - rustup target add i686-pc-windows-msvc
32 - rustup component add rust-src
33 - cargo install xargo || echo "Skipping xargo install"
38 # Test and install plain miri
39 cargo build --release --all-features &&
40 cargo test --release --all-features &&
41 cargo install --all-features --force --path .
43 # get ourselves a MIR-full libstd
45 export MIRI_SYSROOT=~/.xargo/HOST
47 # run all tests with full mir
48 cargo test --release --all-features
52 if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
53 cargo miri -q -- -Zmiri-start-fn
55 cargo miri -q -- -Zmiri-start-fn >stdout.real 2>stderr.real &&
56 cat stdout.real stderr.real &&
57 # Test `cargo miri` output. Not on mac because output redirecting doesn't
58 # work. There is no error. It just stops CI.
59 diff -u stdout.ref stdout.real &&
60 diff -u stderr.ref stderr.real
62 # test `cargo miri test`
74 - RUST_TEST_NOCAPTURE=1