-
Notifications
You must be signed in to change notification settings - Fork 182
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
Running tests with different feature sets / architectures #63
Comments
You can run |
Thanks; that's a great tip for the command line you need to run in order to invoke cargo test with a certain set of features. Suppose a crate has three features A, B, and C, and A is on by default. You may want to test all the permutations:
You want to do this because enabling or disabling features could cause the crate to compile or not compile. At the very least, you'd want to test with the But, supposing we do test all permutations, we should check for:
The third one is interesting because if you add code that bloats the binary, but only when a feature is specifically enabled, that's a lot less important than if you add code that bloats the binary even with all features disabled. |
Features are generally meant to be additive. @Manishearth has way more experience with it, so I'd be curious on his recommendation for us. |
Disabling the Probably "no features", "default features", and "all features" are sufficient to cover most cases we care about. We should test more permutations only if it's easy. |
Yeah, no+default+all is a decent set. If we have "weird" features that change how more than just one component work we might want to add both of their cases explicitly to the matrix. E.g. I can see us running no+all with and without the std feature. |
This may solve it for us - https://github.com/frewsxcv/cargo-all-features |
Nice! |
Interesting references: rust-lang/cargo#7507 removed support for both |
@sffc - this is the last issue blocking Q2 deliverables milestone. Can you update its status? |
We should think about how we test different feature sets and architectures. By default,
cargo test
only tests your default architecture and the crate's default features.Examples of things we want to test:
std
vs.no_std
environment (by enabling or disabling thestd
feature)Note: rust-lang/cargo#2911 is a feature request to allow integration tests to choose different feature sets.
The text was updated successfully, but these errors were encountered: