diff --git a/README.md b/README.md index eb1ee05..fc900c5 100644 --- a/README.md +++ b/README.md @@ -33,3 +33,6 @@ If you are getting strange build errors, `cargo clean` can often fix that. If you want to know how long each test took to execute, add `2>&1 | ts -m -i '%.s '` to the end of the command, or use the test flags `-Zunstable-options --report-time` (the latter option also requires `-Zmiri-disable-isolation` in the Miri flags). + +You can also tell `run-test.sh` to use nextest by setting `USE_NEXTEST=1`. +Note however that this will be a lot [slower](https://github.com/rust-lang/miri/issues/5013) than regular test execution. diff --git a/ci-setup.sh b/ci-setup.sh index 9d361a5..43be54b 100644 --- a/ci-setup.sh +++ b/ci-setup.sh @@ -7,7 +7,7 @@ set -euo pipefail sudo apt-get -y install moreutils echo -# And of course we need Rust +# And of course we need Rust with Miri if [[ "$GITHUB_EVENT_NAME" == 'schedule' ]]; then RUST_TOOLCHAIN=nightly else diff --git a/ci-test.sh b/ci-test.sh index 2953d5d..eff82d9 100644 --- a/ci-test.sh +++ b/ci-test.sh @@ -1,6 +1,7 @@ #!/bin/bash set -euo pipefail +# Miri flags we apply everywhere DEFAULTFLAGS="-Zrandomize-layout -Zmiri-strict-provenance" # make sure we keep using the current toolchain even in subdirs that have a toolchain file @@ -12,6 +13,9 @@ cp -a $(rustc --print sysroot)/lib/rustlib/src/rust/ rust-src-patched ( cd rust-src-patched && patch -f -p1 < ../rust-src.diff >/dev/null ) || ( echo "Applying rust-src.diff failed!" && exit 1 ) export MIRI_LIB_SRC=$(pwd)/rust-src-patched/library +# We're not using nextest as that's very slow due to +# . + # run the tests (some also without validation, to exercise those code paths in Miri) case "$1" in core) diff --git a/run-test.sh b/run-test.sh index d517b9f..1c59c24 100755 --- a/run-test.sh +++ b/run-test.sh @@ -9,6 +9,7 @@ set -euo pipefail ## Environment variables: ## MIRI_LIB_SRC: The path to the Rust library directory (`library`). ## Defaults to `$(rustc --print sysroot)/lib/rustlib/src/rust/library`. +## USE_NEXTEST: If non-empty, run `cargo miri nextest run` instead of `cargo miri test`. CRATE=${1:-} if [[ -z "$CRATE" ]]; then @@ -39,4 +40,8 @@ export RUSTDOCFLAGS="${RUSTDOCFLAGS:-} $EXTRAFLAGS" # run test export CARGO_TARGET_DIR=$(pwd)/target -cargo miri test --manifest-path "$MIRI_LIB_SRC/$CRATE/Cargo.toml" "$@" +if [[ -z "${USE_NEXTEST:-}" ]]; then + cargo miri test --manifest-path "$MIRI_LIB_SRC/$CRATE/Cargo.toml" "$@" +else + cargo miri nextest run --manifest-path "$MIRI_LIB_SRC/$CRATE/Cargo.toml" "$@" +fi