Skip to content

Commit 04eb4a9

Browse files
committed
Auto merge of #1415 - RalfJung:test-suite-filter, r=RalfJung
add test suite filter example to README and 'cargo miri --help' Fixes #1414
2 parents 70b66aa + e22baed commit 04eb4a9

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,17 @@ Now you can run your project in Miri:
8383
The first time you run Miri, it will perform some extra setup and install some
8484
dependencies. It will ask you for confirmation before installing anything.
8585

86+
You can pass arguments to Miri after the first `--`, and pass arguments to the
87+
interpreted program or test suite after the second `--`. For example, `cargo
88+
miri run -- -Zmiri-disable-stacked-borrows` runs the program without checking
89+
the aliasing of references. To filter the tests being run, use `cargo miri test
90+
-- -- filter`.
91+
8692
Miri supports cross-execution: if you want to run the program as if it was a
8793
Linux program, you can do `cargo miri run --target x86_64-unknown-linux-gnu`.
8894
This is particularly useful if you are using Windows, as the Linux target is
8995
much better supported than Windows targets.
9096

91-
You can pass arguments to Miri after the first `--`, and pass arguments to the
92-
interpreted program or test suite after the second `--`. For example, `cargo
93-
miri run -- -Zmiri-disable-validation` runs the program without validation of
94-
basic type invariants and without checking the aliasing of references.
95-
9697
When compiling code via `cargo miri`, the `miri` config flag is set. You can
9798
use this to ignore test cases that fail under Miri because they do things Miri
9899
does not support:

src/bin/cargo-miri.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const XARGO_MIN_VERSION: (u32, u32, u32) = (0, 3, 20);
1515
const CARGO_MIRI_HELP: &str = r#"Interprets bin crates and tests in Miri
1616
1717
Usage:
18-
cargo miri [subcommand] [options] [--] [<miri opts>...] [--] [<program opts>...]
18+
cargo miri [subcommand] [<cargo options>...] [--] [<miri options>...] [--] [<program/test suite options>...]
1919
2020
Subcommands:
2121
run Run binaries (default)
@@ -30,6 +30,10 @@ Common options:
3030
Other [options] are the same as `cargo check`. Everything after the first "--" is
3131
passed verbatim to Miri, which will pass everything after the second "--" verbatim
3232
to the interpreted program.
33+
34+
Examples:
35+
cargo miri run -- -Zmiri-disable-stacked-borrows
36+
cargo miri test -- -- test-suite-filter
3337
"#;
3438

3539
#[derive(Copy, Clone, Debug, PartialEq, Eq)]

0 commit comments

Comments
 (0)