-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Feature Requst: Add regex support to test filters #53278
Copy link
Copy link
Open
Labels
A-libtestArea: `#[test]` / the `test` libraryArea: `#[test]` / the `test` libraryC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-libtestArea: `#[test]` / the `test` libraryArea: `#[test]` / the `test` libraryC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
No status
Proposal
I'd like to filter my tests based on a more complex pattern than just substring.
The current behavior of rust tests is that when a pattern is specified, then only tests that contain that pattern as a substring are run.
cargo test -- foowill run only tests that contain the substringfoo.I propose to amend this to allow for a regex syntax.
cargo test -- /regex/which will run tests that match the regexregex.This is "technically" a breaking change because it's possible that people are already using filters with slashes in them, but since test names can't contain slashes these invocations would always be running 0 tests.
Misc