Auto merge of #2841 - RalfJung:compiletest, r=oli-obk
compiletest: complain about unknown flags This would have avoided https://github.com/rust-lang/rust/issues/110102
This commit is contained in:
commit
b4ea41452f
@ -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,
|
||||
}
|
||||
}));
|
||||
|
Loading…
Reference in New Issue
Block a user