How to make a test optional in cargo?


#1

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

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

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