#!/bin/bash
set -euo pipefail
+set -x
# Determine configuration
export RUSTFLAGS="-D warnings"
# Prepare
echo "Build and install miri"
-./miri build --all-targets --locked
./miri install # implicitly locked
+./miri build --all-targets --locked # the build that all the `./miri test` below will use
echo
# Test
echo "Testing host architecture"
fi
+ ## ui test suite
./miri test --locked
if [ -z "${MIRI_TEST_TARGET+exists}" ]; then
# Only for host architecture: tests with optimizations (`-O` is what cargo passes, but crank MIR
MIRIFLAGS="-O -Zmir-opt-level=4" MIRI_SKIP_UI_CHECKS=1 ./miri test --locked -- tests/{pass,panic}
fi
+ ## test-cargo-miri
# On Windows, there is always "python", not "python3" or "python2".
if command -v python3 > /dev/null; then
PYTHON=python3
else
PYTHON=python
fi
-
- # "miri test" has built the sysroot for us, now this should pass without
- # any interactive questions.
${PYTHON} test-cargo-miri/run-test.py
echo
+
+ # Ensure that our benchmarks all work, on the host at least.
+ if [ -z "${MIRI_TEST_TARGET+exists}" ]; then
+ for BENCH in $(ls "bench-cargo-miri"); do
+ cargo miri run --manifest-path bench-cargo-miri/$BENCH/Cargo.toml
+ done
+ fi
}
function run_tests_minimal {
MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests
MIRI_TEST_TARGET=aarch64-apple-darwin run_tests
MIRI_TEST_TARGET=i686-pc-windows-msvc run_tests
- MIRI_TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal hello integer vec current_dir_with_isolation
+ MIRI_TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal hello integer vec current_dir data_race env
MIRI_TEST_TARGET=thumbv7em-none-eabihf MIRI_NO_STD=1 run_tests_minimal no_std # no_std embedded architecture
;;
x86_64-apple-darwin)