cargo test --all-targets also runs binaries marked as test=false #8338
Labels
A-cargo-targets
Area: selection and definition of targets (lib, bins, examples, tests, benches)
C-bug
Category: bug
S-triage
Status: This issue is waiting on initial triage.
Problem
Running
cargo test --all-targets
apparently runs binaries even when markedtest=false
. This is a problem in particular withcargo fuzz
targets, that do some linker dark magic and start trying to fuzz during the test session, failing as it wasn't built for it.Steps
First, provision the following files:
Cargo.toml
:src/lib.rs
:example-bin/main.rs
:Then, running
cargo test --all-targets
should result in a message like the following:Possible Solution(s)
Maybe it'd be possible to just not call binaries that are tagged
test=false
, even when ran with--all-targets
, seeing astest=false
should clearly stipulate that there are no tests to be found here?Notes
Output of
cargo version
:cargo 1.41.0
Anyway, thank you for all you do on cargo! It's a great piece of software, and I just wanted to report this small hiccup :)
The text was updated successfully, but these errors were encountered: