Can tests be built in release mode using Cargo?

I use cargo build --release to create my project in release configuration and cargo test to create and run my tests.

However, I would also like to build my tests in release mode; can this be done with cargo?

+6
source share
1 answer

cargo test --release does not exist yet: # 691 . The only way to control this at the moment is to set the opt-level in the [profile.test] section of your Cargo.toml, as suggested by Victor Dahl.

+5
source

Source: https://habr.com/ru/post/985762/


All Articles