Skip to content
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

cargo insta test cli: add --disable-nextest-doctest option #438

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions cargo-insta/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ struct TestRunnerOptions {
/// Build for the target triple
#[arg(long)]
target: Option<String>,
/// 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)]
Expand Down Expand Up @@ -965,6 +968,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");
}
Expand Down