Skip to content

Commit

Permalink
compiletest: complain about unknown flags
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Apr 13, 2023
1 parent 7315b6d commit 69b023f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/tools/miri/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 69b023f

Please sign in to comment.