-
-
Notifications
You must be signed in to change notification settings - Fork 106
Add support for doctests #16
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
So I use the However, the doctest file name is made from a normalisation of the path (all path separators replaced with I made an issue in rust about bundling attribute information into the file name to make it easier for people writing tools using this feature rust-lang/rust#92597 and if you're interested in seeing my code it's in https://github.com./xd009642/tarpaulin in Hope this is helpful, nextest looks pretty nifty 🎉 |
There are also |
Can I suggest that until this is added this is called out in the docs in a visible way? I recently was made aware how tricky doctests are to handle, but other users might not be aware. Your crate seems quite nice based on my limited usage, and it would be a shame if they didn't give it a fair chance because they thought it was broken and "skipping tests". |
This is a workaround for nextest-rs/nextest#16
nextest currently does not run documenation tests, see this [1] issue. [1] - nextest-rs/nextest#16
Nextest doesn't run doc tests, so we need to run them with `cargo test --workspace --doc`. See nextest-rs/nextest#16 Follow-up for #5457
Cargo nextest doesn't run doctest so we missed that: nextest-rs/nextest#16
Cargo nextest doesn't run doctest so we missed that: nextest-rs/nextest#16
As [`cargo-nextest` does not support running doc tests](nextest-rs/nextest#16), we need a `cargo test --doc` step as well.
Rustdoc may gain the unstable flag |
Separately, would it be possible for nextest to just run Of course |
From a rustdoc perspecive, we defiantly want nextest to be able to use this, and if it can't that's a flaw with rustdoc's thing, and we'd love to hear about this. Ideally, I'd love to see nextest use this (as an experimental feature) before it gets stabilized, to give us some confidence it's broadly useful |
Cargo wants to have |
This would be really nice to have -- I don't expect to have any time to work on it soon, but some assistance (maybe a prototype within nextest) would be greatly appreciated. |
Currently, nextest doesn't support Rust doctests. This is because doctests are not exposed in stable Rust the way regular test binaries are, and are instead treated as special by
cargo test
.One nightly-only fix that might work is to collect doctest executables through
-Z unstable-options --persist-doctests
. However, this isn't a stable approach so it must be used with care.Note: You can run
cargo test --doc
as a separate step fromcargo nextest run
. This will not incur a performance penalty:cargo nextest run && cargo test --doc
will not cause any more builds than a plaincargo test
that runs doctests.The text was updated successfully, but these errors were encountered: