-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Specify a different target when running unit tests #8761
Specify a different target when running unit tests #8761
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Some things I am still not pleased with...
Open to ideas for the best way to get the context for the --tests flag within the |
Perhaps a better way to implement this is just to use the cargo make tool... |
Thanks for the PR! We discussed this a bit at the last Cargo meeting, and we agree that this may not be the best way to implement it. Especially the gotchas you mention ( |
Sorry for such a late reply. Yes. I think the cargo-make tool solves the problem this pull request was trying to address. |
When working with bare metal embedded systems, it would be nice to be able to run unit tests on your host machine using
cargo test
and then deploy to the target device usingcargo run
. Currently, to build different targets between tests and regular builds, your only option is to explicitly use the--target
flag when invoking cargo.The purpose of this pull request is have different targets between
cargo build
andcargo test
without the need for the--target
flag.This was achieved by changing the
.cargo/config.toml
options.Closes #6784