-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a --no-examples switch to cargo test #5387
Comments
This seems reasonable. If you'd be interested in writing a PR, we'd likely accept it. |
One approach to skip examples is to do Starting in Rust 1.27 (beta), you can also do unit tests and integration tests (without examples) with |
@ehuss Thanks for the clarification! In that case, perhaps what we need here is just an added sentence in the documentation, pointing people to the relevant options. |
@joshtriplett I've been thinking for a while now about writing more detailed documentation about the default target and profile selection, and how target options like |
@ehuss Thank you very much! Shall I leave the issue open for tracking possible documentation changes or shall I close it? |
In cargo test's help, add that examples are built Also clarify that --lib runs the library's unit tests. Closes #5387
Once Rust 1.27 is released we can use a more general command for both unit and integration tests: ``` cargo test --tests --lib ``` rust-lang/cargo#5387 (comment) Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
Once Rust 1.27 is released we can use a more general command for both unit and integration tests: ``` cargo test --tests --lib ``` rust-lang/cargo#5387 (comment) Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
cargo test
has an--examples
switch which checks "that all examples compile". However, this seems to be the default when runningcargo test
, which makes the switch effectively a no-op.But sometimes when I do refactoring, I first wan't to check whether all library tests run and then I want to fix the examples. Therefore, having a
--no-examples
switch would be really helpful.The text was updated successfully, but these errors were encountered: