-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
cargo test --test
does not find any tests
#7864
Comments
Do you have separate tests in your project? The |
No, the tests are integrated in the project I tested it on. The output of
but a single test can selectively be run via
Meaning all the functionality I am seeking exists, but perhaps it is not exposed? How can I get a list of tests (not test files) without running them all? |
You can run the test executable with the Otherwise, there aren't really any easy ways to get the test names. |
I'll leave this open, though it really seems to cover a few different issues:
|
I think the new help output covers this
|
I feel like this would be best left to rust-lang/rust#49359 |
fix(cli): Clarify --test is for targets, not test functions We already refer to test targets as "test targets" instead of "tests" in `--test` but not `--tests` or in the error output. This makes it uniformly refer to them as "test targets", making it clearer that these aren't test functions. Fixes #7864
Background: I'm improving fish's dynamic shell completions for
cargo
to do things like havecargo run --bin <TAB>
give you a list of available binaries to choose from for tab completion.It seems that cargo's dynamic test discovery is broken (or never implemented?).
e.g. while
cargo bench --bench
returns a list of all benchmarks along with the error message:cargo test --test
always returns "no tests available" incorrectly:while actually running
cargo test
shows that cargo has no problem enumerating tests:The text was updated successfully, but these errors were encountered: