Open
Description
Problem
When a crate has no unit tests (via test = false
in its manifest), I would expect cargo to never ever try to run unit tests for that crate.
And yet it turns out that cargo test --lib
will run the unit tests.
Steps
- Run
cargo test --lib --bins --examples --tests --benches
(in an attempt to run "everything except for doc tests"), or justcargo test --lib
- Note how even if the library has unit tests are disabled, cargo will run them
Running unittests src/lib.rs (build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps/core-04ceb2ced8c36de5)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 7.54µs
Possible Solution(s)
--lib
should just be a filter, removing from the usual test set everything that's not a "library unit test". It should not add things that were not present to begin with.
Notes
This is related to but different from #10936
Version
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status