Description
I originally reported this against cargo at rust-lang/cargo#10792, but was told this is more of a rustdoc problem.
The goal is that when I have a diverging doctest, like the following silly one:
/// ```rust
/// eprintln!("stderr");
/// println!("stdout");
/// loop {}
/// ```
pub fn uwu() {}
Then I want to be able to use cargo test --doc -- --nocapture
to debug what is going on by seeing the output of the test. But that doesn't happen, output is still captured. --nocapture
seems to only control whether the output of rustc as it builds the test is captured or printed; it has no effect on the stdout/stderr of the test itself. That is quite inconsistent with regular unit tests where it controls the output of the test itself.
Instead I have to do RUSTDOCFLAGS="-Zunstable-options --nocapture" cargo test --doc
, which is rather hard to find.
To make things even more surprising, RUSTDOCFLAGS="-Zunstable-options --nocapture" cargo test --doc -- --nocapture
fails with an error: "Option 'nocapture' given more than once".
Cc @rust-lang/rustdoc
Metadata
Metadata
Assignees
Labels
Type
Projects
Status