Skip to content

add test suite filter example to README and 'cargo miri --help' #1415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,17 @@ Now you can run your project in Miri:
The first time you run Miri, it will perform some extra setup and install some
dependencies. It will ask you for confirmation before installing anything.

You can pass arguments to Miri after the first `--`, and pass arguments to the
interpreted program or test suite after the second `--`. For example, `cargo
miri run -- -Zmiri-disable-stacked-borrows` runs the program without checking
the aliasing of references. To filter the tests being run, use `cargo miri test
-- -- filter`.

Miri supports cross-execution: if you want to run the program as if it was a
Linux program, you can do `cargo miri run --target x86_64-unknown-linux-gnu`.
This is particularly useful if you are using Windows, as the Linux target is
much better supported than Windows targets.

You can pass arguments to Miri after the first `--`, and pass arguments to the
interpreted program or test suite after the second `--`. For example, `cargo
miri run -- -Zmiri-disable-validation` runs the program without validation of
basic type invariants and without checking the aliasing of references.

When compiling code via `cargo miri`, the `miri` config flag is set. You can
use this to ignore test cases that fail under Miri because they do things Miri
does not support:
Expand Down
6 changes: 5 additions & 1 deletion src/bin/cargo-miri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const XARGO_MIN_VERSION: (u32, u32, u32) = (0, 3, 20);
const CARGO_MIRI_HELP: &str = r#"Interprets bin crates and tests in Miri

Usage:
cargo miri [subcommand] [options] [--] [<miri opts>...] [--] [<program opts>...]
cargo miri [subcommand] [<cargo options>...] [--] [<miri options>...] [--] [<program/test suite options>...]

Subcommands:
run Run binaries (default)
Expand All @@ -30,6 +30,10 @@ Common options:
Other [options] are the same as `cargo check`. Everything after the first "--" is
passed verbatim to Miri, which will pass everything after the second "--" verbatim
to the interpreted program.

Examples:
cargo miri run -- -Zmiri-disable-stacked-borrows
cargo miri test -- -- test-suite-filter
"#;

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