Skip to content
Merged
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
23 changes: 14 additions & 9 deletions src/bootstrap/src/core/config/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,16 +570,21 @@ impl Subcommand {

pub fn test_target(&self) -> TestTarget {
match *self {
Subcommand::Test { all_targets, doc, tests, .. }
| Subcommand::Miri { all_targets, doc, tests, .. } => match (all_targets, doc, tests) {
(true, true, _) | (true, _, true) | (_, true, true) => {
panic!("You can only set one of `--all-targets`, `--doc` and `--tests`.")
Subcommand::Test { mut all_targets, doc, tests, no_doc, .. }
| Subcommand::Miri { mut all_targets, doc, tests, no_doc, .. } => {
// for backwards compatibility --no-doc keeps working
all_targets = all_targets || no_doc;

match (all_targets, doc, tests) {
(true, true, _) | (true, _, true) | (_, true, true) => {
panic!("You can only set one of `--all-targets`, `--doc` and `--tests`.")
}
(true, false, false) => TestTarget::AllTargets,
(false, true, false) => TestTarget::DocOnly,
(false, false, true) => TestTarget::Tests,
(false, false, false) => TestTarget::Default,
}
(true, false, false) => TestTarget::AllTargets,
(false, true, false) => TestTarget::DocOnly,
(false, false, true) => TestTarget::Tests,
(false, false, false) => TestTarget::Default,
},
}
_ => TestTarget::Default,
}
}
Expand Down
Loading