Skip to content

Commit bf3c46c

Browse files
committed
Allow subdirectories to be tested by x.py test
1 parent cff1bdb commit bf3c46c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/bootstrap/test.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -1184,8 +1184,13 @@ impl Step for Compiletest {
11841184
Err(_) => p,
11851185
}
11861186
})
1187-
.filter(|p| p.starts_with(suite_path) && p.is_file())
1188-
.map(|p| p.strip_prefix(suite_path).unwrap().to_str().unwrap())
1187+
.filter(|p| p.starts_with(suite_path) && (p.is_dir() || p.is_file()))
1188+
.filter_map(|p| {
1189+
match p.strip_prefix(suite_path).ok().and_then(|p| p.to_str()) {
1190+
Some(s) if s != "" => Some(s),
1191+
_ => None,
1192+
}
1193+
})
11891194
.collect();
11901195

11911196
test_args.append(&mut builder.config.cmd.test_args());

0 commit comments

Comments
 (0)