Builder: Warn if test file does not exist

This commit is contained in:
Dániel Buga 2021-01-04 16:09:59 +01:00
parent f6b6d5cf64
commit 6002e78392

View File

@ -1126,7 +1126,19 @@ fn run(self, builder: &Builder<'_>) {
Ok(path) => path,
Err(_) => p,
})
.filter(|p| p.starts_with(suite_path) && (p.is_dir() || p.is_file()))
.filter(|p| p.starts_with(suite_path))
.filter(|p| {
let exists = p.is_dir() || p.is_file();
if !exists {
if let Some(p) = p.to_str() {
builder.info(&format!(
"Warning: Skipping \"{}\": not a regular file or directory",
p
));
}
}
exists
})
.filter_map(|p| {
// Since test suite paths are themselves directories, if we don't
// specify a directory or file, we'll get an empty string here