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

rustdoc: support for the --nocapture feature of libtest #26309

Closed
IvanUkhov opened this issue Jun 15, 2015 · 7 comments · Fixed by #86230
Closed

rustdoc: support for the --nocapture feature of libtest #26309

IvanUkhov opened this issue Jun 15, 2015 · 7 comments · Fixed by #86230
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@IvanUkhov
Copy link
Contributor

Currently, librustdoc is diligently passing test arguments to libtest via --test-args, including --nocapture. However, librustdoc internally captures the output of doc-tests and doesn’t let it get through to libtest. Consequently, the usage of --nocapture in this context is somewhat limited (when supplied it reveals compiler warnings, for instance) and doesn’t serve its main purpose. This behavior is inconsistent with the rest of the testing.

Regards,
Ivan

@steveklabnik steveklabnik added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jun 15, 2015
@steveklabnik steveklabnik added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Nov 15, 2016
@steveklabnik steveklabnik added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. and removed T-tools labels May 18, 2017
@cramertj
Copy link
Member

cramertj commented Jun 29, 2018

Ping @steveklabnik -- has there been any more discussion about this?

@gnzlbg
Copy link
Contributor

gnzlbg commented Sep 21, 2018

Ping @QuietMisdreavus , can someone cc docs team here? This has been open for a long time.

@QuietMisdreavus
Copy link
Member

cc @rust-lang/rustdoc

IIRC, the last time we tried to make --nocapture work, we hit problems with how the output was passed from doctests back to libtest. @GuillaumeGomez, do you remember what happened there?

@GuillaumeGomez
Copy link
Member

I still have an in-progress branch on this one. It's tricky because libtest is handling outputs itself and we need to add functionalities to tell it not to do it. But then, outputs get lost... somewhere. This is where I am now. Trying to get back outputs (both stdout and stderr).

@steveklabnik
Copy link
Member

Triage: I don't think anything has changed here.

@GuillaumeGomez
Copy link
Member

Definitely didn't. I start I'll start over from start when I'll get back to it.

@pipehappy1
Copy link

This feature is much appreciated. Without this, the doc test can only benefit doc reader but less useful for debugging during dev.

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jul 17, 2021
Add --nocapture option to rustdoc

Fixes rust-lang#26309.
Fixes rust-lang#45724.

Once this PR is merged, I'll send a PR to cargo to also pass `--nocapture` to rustdoc.

cc `@jyn514`
r? `@camelid`
@bors bors closed this as completed in 0fce468 Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants