diff --git a/cargo-insta/src/cli.rs b/cargo-insta/src/cli.rs index 2a308f23..4be924eb 100644 --- a/cargo-insta/src/cli.rs +++ b/cargo-insta/src/cli.rs @@ -168,6 +168,9 @@ struct TestCommand { /// Build for the target triple #[structopt(long)] target: Option, + /// Do not run `cargo test --doc` after `cargo nextest`, even if test specifiers would otherwise include doctests. + #[structopt(long)] + disable_nextest_doctest: bool, /// Follow up with review. #[structopt(long)] review: bool, @@ -825,6 +828,9 @@ fn prepare_test_runner<'snapshot_ref>( None }; let mut prevents_doc_run = false; + if cmd.disable_nextest_doctest { + prevents_doc_run = true; + } if cmd.target_args.all || cmd.target_args.workspace { proc.arg("--all"); }