-
Notifications
You must be signed in to change notification settings - Fork 831
Reactivate doctests for guide #385
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
Comments
I'd love to have doctests on CI! Playing around with rustdoc, I found that Also note that you don't need to clean everything, just |
At the moment I think the easiest solution is just adding Other possible solutions could be using skeptic in case this gets solved there (WIP in budziq/rust-skeptic#18 (comment)) or using the |
I think the situation could be improved by using doc-comment to test the guide. We could remove the workarounds introduced in #387 and hopefully the solution is more robust since the doctests are integrated with cargo. One could simply add something like this to lib.rs: # test readme
doctest!("../README.md", readme_md);
# test user guide
doctest!("../guide/src/get_started.md", guide_get_started_md);
doctest!("../guide/src/conversions.md", guide_conversions_md);
doctest!("../guide/src/class.md", guide_class_md);
... What do you think? New or renamed files would have to be manually added. My guess is that this could also be solved with macros somehow. |
I like the idea! doc-comment looks really promising. |
To avoid that the examples in the guide are in a broken state, I'd like to reactivate the tests which were ignored in f9ff7cd. I think assert-rs/docmatic#4 can be mitigated by changing .travis.yml and appveyor.yml so that
cargo clean
is executed before the tests.Unfortunately, it seems that
extern crate pyo3;
has to be added to the examples in order to make the doctests pass (rust-lang/rust#58875). At least we could hide them from the output with#
. This would also fix the "Run this code" button in the guide which does not work at the moment.If this sounds ok I could start working on this.
The text was updated successfully, but these errors were encountered: