Auto merge of #11043 - Alexendoo:testname, r=Jarcho

Use substring matching for TESTNAME

Restores the previous behaviour of matching using a substring match rather than needing a full match

changelog: none
This commit is contained in:
bors 2023-06-28 02:53:40 +00:00
commit 1df9110b85
1 changed files with 1 additions and 6 deletions

View File

@ -64,12 +64,7 @@ fn base_config(test_dir: &str) -> compiletest::Config {
fn test_filter() -> Box<dyn Sync + Fn(&Path) -> bool> {
if let Ok(filters) = env::var("TESTNAME") {
let filters: Vec<_> = filters.split(',').map(ToString::to_string).collect();
Box::new(move |path| {
filters.is_empty()
|| filters
.iter()
.any(|f| path.file_stem().map_or(false, |stem| stem == f.as_str()))
})
Box::new(move |path| filters.iter().any(|f| path.to_string_lossy().contains(f)))
} else {
Box::new(|_| true)
}