-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'cargo test --release' doesn't use release profile #6522
Comments
See previously #831. |
Tests use the test/bench profiles instead of dev/release (so |
In that case, I think there may be two distinct issues at play:
|
(That second point seems to tie closely to #2085.) |
If #2085 is likely to happen, then I agree that this can be closed in favor of that. If it will be a while, I'd still appreciate a clearer description in the output of |
#2085 hasn't been particularly active, so I think we'd be happy to accept PRs that resolve this by bringing clarity to the help messaging. |
I would personally like to take the route of #2085, but it's obviously a large change and will take some time, and as a result needs to be prioritized against everything else |
Closing as fixed, as part of #9943, profile selection was simplified and |
Problem
cargo test --release
does not appear to respect theprofile.release
configuration inCargo.toml
.I configured the
profile.release
section of myCargo.toml
file to setoverflow-checks = true
. (See full listings below.)I wanted to confirm that I got the configuration right, so I wrote a test that intentionally overflows. I first ran
cargo test
to ensure that it panics, then rancargo test --release
to confirm that it continues to panic using therelease
configuration. I was surprised to see that it did not.I moved the function up into a
fn main
and confirmed that it panics there (as expected) when usingcargo run --release
.Steps
Cargo.toml
:src/main.rs
:Note that
cargo run
andcargo run --release
both panic, andcargo test
reports that both tests fail.cargo test --release
unexpectedly reports that both tests passed.Notes
Output of
cargo version
:The text was updated successfully, but these errors were encountered: