mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Auto merge of #2960 - oli-obk:run_filter, r=oli-obk
Restore test filtering by substring. Previously it was only looking for tests whose path was a prefix of the given filter fixes #2958
This commit is contained in:
commit
7591c51436
@ -145,7 +145,8 @@ fn run_tests(mode: Mode, path: &str, target: &str, with_dependencies: bool) -> R
|
||||
// The files we're actually interested in (all `.rs` files).
|
||||
|path| {
|
||||
path.extension().is_some_and(|ext| ext == "rs")
|
||||
&& (filters.is_empty() || filters.iter().any(|f| path.starts_with(f)))
|
||||
&& (filters.is_empty()
|
||||
|| filters.iter().any(|f| path.display().to_string().contains(f)))
|
||||
},
|
||||
// This could be used to overwrite the `Config` on a per-test basis.
|
||||
|_, _| None,
|
||||
|
Loading…
Reference in New Issue
Block a user