-
Notifications
You must be signed in to change notification settings - Fork 1
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 the ability to build an entire workspace or a specific executable #6
Conversation
This adds a `BinTestBuilder` struct, which can be used to add the `--workspace` flag to `cargo build` and/or to build a specific executable
looks good on a first glance. I am out of office, will come back on this next days. |
All good, no hurry over the holiday period! |
Okay, I squeezed one extra flag into this that I wanted, hopefully that's not too controversial! I should be 100% done with this branch now, as I'm happy with my test workflow where I'm using this |
I created a new 'devel' branch, updated the crate there (msrv, edition, metadata and other bits) and merged this PR. Please test and tell me your opinions. This will be the base of a 1.1.0-devel release I can do sometime soon, then your rust code using bintest can depend on that. I did a small change: the builder is now available over the In future we can add more flags to the builder. Another observation: we could now have a small workspace in this crate creating a binary which is used to test this crate itself :) |
Cheers, will check out that branch now and give it a test! The small change certainly seems nicer, keeping the needed imports minimal 👍 |
@cehteh Yep, that's working nicely for me, and I definitely prefer the new API - I'm not 100% sure the name This PR shows the change (and my usecase) if you're curious. (...though something unrelated appears to have broken the CI)
Also I just spotted this line - that seems like a very nifty idea! |
Same here, i am open for better name suggestions. I use this 'hidden builder pattern' or how its named frequently but i havent settled on good names yet, sometimes I use 'Foo::build().with_option().with_another_option().finish()' but i am not satisfied with that either. |
Maybe |
@cehteh What's your plan for a new published release? I've been pointing at the |
When you like a stable release ASAP then I can do it. In some older codebase I use lazy_static! similar to how you using the newer Lazy. Which makes me think:
So when you don't need it ASAP give me a few day and/or comment on the Lazy idea |
Yeah, fair enough - there's no hurry at all really, this is just a personal project so theres's no reall ASAP, it would just be nice if I could remove as many of my git dependencies as I can at some point. I can file an issue recommending the |
This PR adds a
BinTestBuilder
struct, which can be used to add the--workspace
flag tocargo build
and/or to build a specific executable with the--bin
flag.This was all fine for my specific use-case, but I'm very open to suggestions or alternative API ideas - if we're happy with this though, we could also use it to handle the
RELEASE_BUILD
flag too, though I wouldn't necessarily do that as part of this PR