Fail or warn when using an overrestricitve test filter that filters all tests
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 15.5k
- Forks
- 3k
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 51
Description
I'm not sure if this or the rust repo (libtest) is the right place to report this.
It's possible to run cargo test <pattern> to run the tests that match the given pattern.
However, if I run cargo test this_does_not_exist, everything looks green in the output. For example, if I run cargo test mod_floors in Chrono, it will look like this:

On the first glance, it looks like everything is green and all tests passed.
It doesn't tell me that no tests were executed. I really wanted to run cargo test mod_floor:

It would be nice if cargo test somehow tells me that no tests were executed.
Maybe adding a yellow or red warning text could be a good start?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the behavior with cargo test this_does_not_exist and compare it with a pattern that matches tests. Trace Cargo's test-filtering and result-reporting entry points; done means an overrestrictive filter clearly warns or fails when no tests are executed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100