Can tests be built in release mode using Cargo?

后端 未结 1 1376
遇见更好的自我
遇见更好的自我 2020-12-18 19:23

I\'m using cargo build --release to build my project in release configuration and cargo test to build and run my tests.

However, I\'d like

相关标签:
1条回答
  • 2020-12-18 19:56

    cargo test --release exists, but it is slightly different than just enabling optimizations. For example, debug assertions become disabled.

    You can also set opt-level in the [profile.test] section of your Cargo.toml, as Viktor Dahl suggests.

    0 讨论(0)
提交回复
热议问题