Cargo: Deprecate the "bench" and "test" profiles

Created on 27 Oct 2015  ·  3Comments  ·  Source: rust-lang/cargo

AFAICT, any time the "bench" or "test" profile is different from "release", it is a misconfiguration. Cargo should warn whenever a "bench" or "test" profile is defined, and it should always use the "dev" or "release" profile, based on whether or not "--release" was passed.

From #cargo IRC chat today:

I also noticed something strange about profiles: why would one want the "test" profile or "bench" profile to ever be different from "release"?
If they were different, then you wouldn't be testing or measuring what you release.
that's a good point, I've never seen a difference in practice at least
I had mine different for a while because I hadn't thought about it. I'd only changed "release"

A-profiles

Most helpful comment

Test should be different from release because I don't want to spend ten minutes waiting for optimizations every time I run tests.

cargo test should use the dev profile and cargo test --release should use the release profile. cargo bench should always build a release build.

All 3 comments

Test should be different from release because I don't want to spend ten minutes waiting for optimizations every time I run tests.

Test should be different from release because I don't want to spend ten minutes waiting for optimizations every time I run tests.

cargo test should use the dev profile and cargo test --release should use the release profile. cargo bench should always build a release build.

Ah, yes. That makes sense.

Was this page helpful?
0 / 5 - 0 ratings