-
-
Notifications
You must be signed in to change notification settings - Fork 98
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 support for doctests #16
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". |
Due to a limitation in how doctests are exposed in stable Rust, nextest does not actually run them by default. We unfortunately need an explicit step for the time being. See: - nextest-rs/nextest#16
49: Ensure that we run the doctests r=elasticdog a=elasticdog Due to a limitation in how doctests are exposed in stable Rust, nextest does not actually run them by default. We unfortunately need an explicit step for the time being. See: - nextest-rs/nextest#16 Co-authored-by: Aaron Bull Schaefer <[email protected]>
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 does not support doc tests nextest-rs/nextest#16 - **Fix doc tests** - **Run doc tests as part of CI**
Nextest doesn't run doc tests, so we need to run them with `cargo test --doc`. See nextest-rs/nextest#16
Nextest doesn't run doc tests, so we need to run them with `cargo test --doc`. See 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.
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: