about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorAlex Macleod <alex@macleod.io>2023-06-27 20:36:05 +0000
committerAlex Macleod <alex@macleod.io>2023-06-27 20:36:05 +0000
commit8647e29159246a1616f643ad8128ac92299a9743 (patch)
tree1ce48cb1f09e7aab8969ad76da838120f3c7aa02 /tests
parent2e329050c9516bf56a17233a8471f115299d3e1f (diff)
downloadrust-8647e29159246a1616f643ad8128ac92299a9743.tar.gz
rust-8647e29159246a1616f643ad8128ac92299a9743.zip
Use substring matching for TESTNAME
Diffstat (limited to 'tests')
-rw-r--r--tests/compile-test.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/tests/compile-test.rs b/tests/compile-test.rs
index 745faaddda6..08d41adf9e7 100644
--- a/tests/compile-test.rs
+++ b/tests/compile-test.rs
@@ -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)
     }