Skip to content

Add warning message when no tests are run. #11875

@Kuly14

Description

@Kuly14

Problem

When trying to run a specific test with a command like:

cargo test tests::test_lib

If you make a mistake in the path to the test it won't display any warning, it will just not run any tests:

Screenshot 2023-03-22 at 14 32 23

As you can see in the screenshot if you make a typo in the path it will still look like it passed even though the test doesn't exist:

Screenshot 2023-03-22 at 14 32 30

Proposed Solution

In my opinion, we should add a warning when the path leads to a nonexistent test e.g.:

WARNING: The test doesn't exist

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-testS-blocked-externalStatus: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions