cargo test --lib should not error when no lib is present #15231
Labels
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Command-test
S-triage
Status: This issue is waiting on initial triage.
Problem
This is somewhat related to what #10958 requests, but the target and use-case are different.
I need to run the unit tests in several workspaces. The only way I am aware of that can achieve this is via
The problem is that I am running this command over arbitrary-structured workspaces that may have 0 or more binaries and 0 or more libraries within them. The scenarios boil down to the 3 cases below:
cargo test
completes with a warningcargo test
completescargo test
failsIf there are 0 binaries, then the command completes with a warning, but if there are no libs in the workspace it will fail with the following error:
Proposed Solution
I think there are two options here:
--lib
to warn instead of error when no libraries are present.--libs
argument that warns when no libraries are present. This would keep the behaviour of--lib
intact.I would be happy to implement the change myself.
Notes
No response
The text was updated successfully, but these errors were encountered: