From 741337a6a65727679e2c5774ce3f458f40574f85 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Thu, 21 Sep 2023 14:24:13 -0400 Subject: [PATCH] cargo-insta: support --all-targets See https://github.com/rust-lang/cargo/blob/5bf83d8146f1c674dc874ad20ab209490aec6422/tests/testsuite/cargo_test/help/stdout.log#L40. --- cargo-insta/src/cli.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cargo-insta/src/cli.rs b/cargo-insta/src/cli.rs index 25e344fd..add2ce83 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: Option, /// 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");