Skip to content

Commit

Permalink
Auto merge of #11043 - Alexendoo:testname, r=Jarcho
Browse files Browse the repository at this point in the history
Use substring matching for TESTNAME

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

changelog: none
  • Loading branch information
bors committed Jun 28, 2023
2 parents 9e57657 + 8647e29 commit 1df9110
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions tests/compile-test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 1df9110

Please sign in to comment.