Skip to content

Commit 5dc23be

Browse files
committed
rustdoc: output stderr on doc-test fail
Forward output from stderr when a test executable panics/fails.
1 parent c5370be commit 5dc23be

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustdoc/test.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,9 @@ fn runtest(test: &str, cratename: &str, libs: SearchPaths,
243243
if should_panic && out.status.success() {
244244
panic!("test executable succeeded when it should have failed");
245245
} else if !should_panic && !out.status.success() {
246-
panic!("test executable failed:\n{:?}",
247-
str::from_utf8(&out.stdout));
246+
panic!("test executable failed:\n{}\n{}",
247+
str::from_utf8(&out.stdout).unwrap_or(""),
248+
str::from_utf8(&out.stderr).unwrap_or(""));
248249
}
249250
}
250251
}

0 commit comments

Comments
 (0)