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
// flag is respected, so providing an empty --test-args conflicts with
// any following it.
match p.strip_prefix(suite_path).ok().and_then(|p| p.to_str()) {
- Some(s) if s != "" => Some(s),
+ Some(s) if !s.is_empty() => Some(s),
_ => None,
}
})