diff --git a/cargo-insta/src/cli.rs b/cargo-insta/src/cli.rs index f493d0d3..4195b40d 100644 --- a/cargo-insta/src/cli.rs +++ b/cargo-insta/src/cli.rs @@ -173,6 +173,9 @@ struct TestRunnerOptions { /// Build for the target triple #[arg(long)] target: Option, + /// Do not run `cargo test --doc` after `cargo nextest`, even if test specifiers would otherwise include doctests. + #[arg(long, short = 'N')] + disable_nextest_doctest: bool, } #[derive(Args, Debug)] @@ -1012,6 +1015,9 @@ fn prepare_test_runner<'snapshot_ref>( None }; let mut prevents_doc_run = false; + if cmd.test_runner_options.disable_nextest_doctest { + prevents_doc_run = true; + } if cmd.target_args.all || cmd.target_args.workspace { proc.arg("--all"); }