Skip to content

Commit

Permalink
Allow subdirectories to be tested by x.py test
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed May 10, 2019
1 parent cff1bdb commit bf3c46c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/bootstrap/test.rs
Expand Up @@ -1184,8 +1184,13 @@ impl Step for Compiletest {
Err(_) => p,
}
})
.filter(|p| p.starts_with(suite_path) && p.is_file())
.map(|p| p.strip_prefix(suite_path).unwrap().to_str().unwrap())
.filter(|p| p.starts_with(suite_path) && (p.is_dir() || p.is_file()))
.filter_map(|p| {
match p.strip_prefix(suite_path).ok().and_then(|p| p.to_str()) {
Some(s) if s != "" => Some(s),
_ => None,
}
})
.collect();

test_args.append(&mut builder.config.cmd.test_args());
Expand Down

0 comments on commit bf3c46c

Please sign in to comment.