-
Notifications
You must be signed in to change notification settings - Fork 19
cargo test --release
should test the release binary not the debug one
#86
Comments
Options for handling this
Anyone have any better ideas of how to expose this to users? @mikerite which works better for your use case? |
The options that make sense to me would be:
That way, for this same line of code:
But if the user does something like: assert_cli::Assert::main_binary()
.with_profile(Profile::Debug)
.unwrap() then it would always omit the I'm not sure that the explicit user override is necessary — not sure how often the use case would come up. I find that if I want to test a separate compilation profile, then I'd run compile everything with that profile, instead of a mix and match, but then again I'm not the world 😅. I'm keen to have a go at this. |
Thanks for the feedback! Do we have a feel for how important customizing the profile is or other parts of running If we do need to support it, an interesting angle on the design is should the API allow Another fun trade off. We are working on a revamp of assert_cli's API, taking in a lot of lessons we've learned.
(you can preview the ideas I'm experimenting with in my branch. Note that I will do force pushes to that branch) |
Hm, based on:
I think defaulting to the current compilation profile would produce code that is used by people. Not implementing the "user may choose the profile" will make it much easier (don't have to store the potential command + args, then rebuild later). Looking at the rewrite, if we just do the first part — default to using the current profile — it should be pretty straightforward to implement whether before or after the rewrite. The second part, I think it's not too difficult to do before the rewrite, but it would be quite difficult to do after — cannot insert arguments in between other arguments. If there isn't a compelling reason to allow the user to change the compilation profile for the tested binary, then the current state of the rewrite is good, otherwise we'd have to have a builder or something to store the profile and construct the |
#97 implements the first part, and I think it's easy to see that it would easily carry over to the current rewrite. I won't attempt to do the second part just yet, seeing that we're not sure we need it. |
Run Rustfmt. Issue assert-rs#86
Closed by #97. If someone has the use case for customized profile (or other customization), then please go ahead and open distinct issues for us to discuss. |
Here is my motivation or use case:
I'm busy writing a solver for a game and I'd like to test it using
assert_cli
. In release mode the solver takes around 2 minutes to run. In debug it takes more than 20 minutes. (I've never waited longer.) For this reason, I only want to test the binary built in release mode. At the moment, this is not possible asassert_cli
doesn't respect the--release
flag.The text was updated successfully, but these errors were encountered: