Skip to content

Commit

Permalink
Run no_parallel tests under miri
Browse files Browse the repository at this point in the history
  • Loading branch information
Imberflur committed Sep 16, 2023
1 parent 0a4b99a commit 6d4724b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 10 additions & 0 deletions miri.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# Convenience script for running Miri, also the same one that the CI runs!

set -e

# use half the available threads since miri can be a bit memory hungry
test_threads=$((($(nproc) - 1) / 2 + 1))
echo using $test_threads threads
Expand All @@ -19,3 +21,11 @@ MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-ignore-leaks" \
--test-threads="$test_threads" \
# use nocapture or run miri directly to see warnings from miri
#--nocapture

# Run tests only available when parallel feature is disabled.
MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-ignore-leaks" \
cargo +nightly miri nextest run \
--no-default-features \
-E "binary(no_parallel)" \
--test-threads="$test_threads"

1 change: 0 additions & 1 deletion tests/no_parallel.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![cfg(not(feature = "parallel"))]
// TODO: ensure we run these with miri too

use std::rc::Rc;

Expand Down

0 comments on commit 6d4724b

Please sign in to comment.