How to make a test optional in cargo?

I've published a crate that also includes exchaustive tests that validate all possible 32-bit inputs to a function:

https://github.com/peter-bertok/float_fast_print/blob/c43a24728e6cbba6273fa9a20656a35297e0a7ed/tests/exhaustive.rs#L8-L11

This takes some hours to run, and hence it shouldn't be included by default to prevent cargo test from hanging unexpectedly. What's the idiomatic method for marking it as an "optional" test that should only be invoked explicitly?

2 Likes

Never mind, I answered my own question:

https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html#ignoring-some-tests-unless-specifically-requested

4 Likes