@rustlang question: I have a feature behind a feature flag, and I want to disable its tests when the feature flag is disabled. But it seems test modules don't see the feature flag attribute. Is there a way to conditionally compile out the tests based on the flag?
-
Show this thread
-
Replying to @littlecalculist @rustlang
#[test] #[cfg(feature = "whatever")] should be all you need. Can you elaborate on what you mean by test modules don't see the feature flag?
2 replies 0 retweets 1 like -
Doh, it’s totally my fault, it’s a nested crate inside the test directory tree
1 reply 0 retweets 0 likes
Replying to @littlecalculist @rustlang
We did it, team! \o/
4:08 PM - 30 Jan 2020
0 replies
0 retweets
2 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.