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

Adding support to check tests / examples #24

Open
elichai opened this issue Feb 10, 2019 · 3 comments
Open

Adding support to check tests / examples #24

elichai opened this issue Feb 10, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@elichai
Copy link

elichai commented Feb 10, 2019

Hi,
I have a proc-macro that I want to make sure that the results are always no-std compatible (I'll add this to the CI),
for that I need this to check the examples/tests of my crate instead of the crate itself.
In cargo clippy/check/fmt you can use: --examples / --tests

Thanks.

@hobofan
Copy link
Owner

hobofan commented Feb 10, 2019

👍 Checks for examples shouldn't be that hard to implement. I'll look into that! (A PR would also be welcome 😉 )

Cheking tests is more complicated though, I think. IIRC tests always require std to be present, due to how the normal cargo test harness works. So it would be really hard to separate the std that's coming from the test environment from the test contents that are supposed to be no_std.

Would be good to know the crate you want to introduce it for, if possible. (I'm guessing https://github.com/elichai/log-derive ?)

@hobofan hobofan added the enhancement New feature or request label Feb 10, 2019
@elichai
Copy link
Author

elichai commented Feb 10, 2019

Yes, that's the crate :)
Hmm maybe tonight I'll try to look at your code see if I can make a PR for that myself.
Never wrote custom commands to cargo so might be interesting to look at how it's implemented

@elichai
Copy link
Author

elichai commented Feb 10, 2019

Another thing, have you checked if this fails a CI?
would be helpful if it is, otherwise it might only require exiting via std::process::exit(1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants