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

[bootstrap] Give a hard error when filtering tests for a file that does not exist #95353

Merged
merged 1 commit into from
Apr 6, 2022
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
8 changes: 4 additions & 4 deletions src/bootstrap/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,10 @@ pub fn is_valid_test_suite_arg<'a, P: AsRef<Path>>(
let abs_path = builder.src.join(path);
let exists = abs_path.is_dir() || abs_path.is_file();
if !exists {
if let Some(p) = abs_path.to_str() {
builder.info(&format!("Warning: Skipping \"{}\": not a regular file or directory", p));
}
return None;
panic!(
"Invalid test suite filter \"{}\": file or directory does not exist",
abs_path.display()
);
}
// Since test suite paths are themselves directories, if we don't
// specify a directory or file, we'll get an empty string here
Expand Down