diff --git a/cargo-insta/src/cli.rs b/cargo-insta/src/cli.rs index 25e344fd..67fe8fc6 100644 --- a/cargo-insta/src/cli.rs +++ b/cargo-insta/src/cli.rs @@ -154,6 +154,9 @@ struct TestCommand { /// Build artifacts with the specified profile #[structopt(long)] profile: Option, + /// Test all targets (does not include doctests) + #[structopt(long)] + all_targets: bool, /// Activate all available features #[structopt(long)] all_features: bool, @@ -884,6 +887,9 @@ fn prepare_test_runner<'snapshot_ref>( proc.arg("--profile"); proc.arg(profile); } + if cmd.all_targets { + proc.arg("--all-targets"); + } if let Some(n) = cmd.jobs { // use -j instead of --jobs since both nextest and cargo test use it proc.arg("-j");