Skip to content

Commit

Permalink
Auto merge of #2841 - RalfJung:compiletest, r=oli-obk
Browse files Browse the repository at this point in the history
compiletest: complain about unknown flags

This would have avoided rust-lang/rust#110102
  • Loading branch information
bors committed Apr 13, 2023
2 parents 510d727 + ac769bc commit 5665ff8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/compiletest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,24 @@ fn run_tests(mode: Mode, path: &str, target: &str, with_dependencies: bool) -> R
};

// Handle command-line arguments.
let mut after_dashdash = false;
config.path_filter.extend(std::env::args().skip(1).filter(|arg| {
if after_dashdash {
// Just propagate everything.
return true;
}
match &**arg {
"--quiet" => {
config.quiet = true;
false
}
"--" => {
after_dashdash = true;
false
}
s if s.starts_with('-') => {
panic!("unknown compiletest flag `{s}`");
}
_ => true,
}
}));
Expand Down

0 comments on commit 5665ff8

Please sign in to comment.