-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
cargo test --test <testname> builds binaries #7958
Copy link
Copy link
Closed
Labels
A-cargo-targetsArea: selection and definition of targets (lib, bins, examples, tests, benches)Area: selection and definition of targets (lib, bins, examples, tests, benches)A-documenting-cargo-itselfArea: Cargo's documentationArea: Cargo's documentationC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Metadata
Metadata
Assignees
Labels
A-cargo-targetsArea: selection and definition of targets (lib, bins, examples, tests, benches)Area: selection and definition of targets (lib, bins, examples, tests, benches)A-documenting-cargo-itselfArea: Cargo's documentationArea: Cargo's documentationC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Type
Fields
Give feedbackNo fields configured for issues without a type.
Problem
The documentation for cargo seems to suggest that if I run:
cargo test --test apple, then,this should run test
applewithout compiling any of the binaries. However, this doesn't seem to be the case.Steps
cargo new banana.lib.rsfile insrc/. My contents were:bin/insrc/then add a filerun.rs; my contents were:tests/at the project root. Add a simple test filesample.rswith contents:cargo test --test samplebin/run.rsis compiled. We can tell since we can warnings about unused variables from it.Notes
Output of
cargo version: