Skip to content
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

Add cargo test --release #691

Closed
ebfe opened this issue Oct 11, 2014 · 9 comments
Closed

Add cargo test --release #691

ebfe opened this issue Oct 11, 2014 · 9 comments
Labels
Command-test E-easy Experience: Easy

Comments

@ebfe
Copy link
Contributor

ebfe commented Oct 11, 2014

Unless I'm missing something, there is currently no way to run tests with optimizations turned on.

@ebfe
Copy link
Contributor Author

ebfe commented Oct 11, 2014

Setting up [profile.test] works, though now tests are always (slowly) build
using optimizations.

I still think there's value in having a cargo test --release that compiles
using the same options as cargo build --release.

@sfackler
Copy link
Member

👍

@psdh
Copy link
Contributor

psdh commented Mar 9, 2015

I would like to fix this. How should I go about it?

@alexcrichton
Copy link
Member

It'd probably start off with adding --release to the src/bin/test.rs file and then propagating the changes downwards to get the optimizations turned on in src/cargo/ops/cargo_rustc. That being said there's some internal refactoring which needs to happen to enable a change such as this, so I don't think that it will be easy to accomplish unfortunately.

@alexcrichton
Copy link
Member

This should now be very easy to do now that #1441 has landed!

@alexcrichton alexcrichton added the E-easy Experience: Easy label Mar 24, 2015
@alexcrichton
Copy link
Member

@psdh would you still be interested in implementing this?

@psdh
Copy link
Contributor

psdh commented Mar 24, 2015

I was actually trying to figure this out yesterday. I would love to fix this. Does this now just involve changes to the src/bin/test.rs ?

@alexcrichton
Copy link
Member

Yes that should be easy enough to add the flag, and then the other half would be writing a test to ensure that it works correctly (e.g. passes optimization flags).

@alexcrichton
Copy link
Member

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Command-test E-easy Experience: Easy
Projects
None yet
Development

No branches or pull requests

4 participants