Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

cargo test always fails to run. #1000

Answered by jorgecarleitao
HaoYang670 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @HaoYang670 . So, the idea is: cargo test --tests covers everything that is not feature-flagged. cargo test --lib is mostly for tests covering functions that are not public (we have very few).

cargo test includes examples. Unfortunately cargo does not support declaring which feature flags each example requires, and thus we can't provide a cargo test that only tests the examples that do not depend on a feature flag.

My usual dev flow is:

If I am working on a core aspect (no feature flags), run cargo test --tests. If I am working on a specific feature, run cargo test --features ... --tests. I seldom use cargo test --features full, since the CI will handle it (and it seldom provides valu…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@HaoYang670
Comment options

Answer selected by HaoYang670
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants