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

Add option to set global no_run for doc test #70646

Open
Hexilee opened this issue Apr 1, 2020 · 1 comment
Open

Add option to set global no_run for doc test #70646

Hexilee opened this issue Apr 1, 2020 · 1 comment
Labels
A-doctests Area: Documentation tests, run by rustdoc C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Hexilee
Copy link

Hexilee commented Apr 1, 2020

As this issue.

I want to guarantee all examples in external files can pass compiling, but I would not like to run them.

The main reason not to add no_run for each block is many markdown renders cannot correctly recognize a "rust,no_run" block.

So, could we add a option for #[doc] like #[doc(include = "../README.md", no_run)]?

@jonas-schievink jonas-schievink added A-doctests Area: Documentation tests, run by rustdoc C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Apr 1, 2020
@jyn514
Copy link
Member

jyn514 commented Jul 2, 2021

You said "global" in the title, but your example is not global. Did you want this to be specific to included docs? Note that --no-run already exists if you want to do this for all doctests.

I'm also unsure why this is useful - why not just add no_run to the file you're including?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-doctests Area: Documentation tests, run by rustdoc C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
Status: No status
Development

No branches or pull requests

3 participants