rustdoc: output stderr on doc-test fail
Forward output from stderr when a test executable panics/fails.
This commit is contained in:
parent
c5370be36e
commit
5dc23be5b1
|
@ -243,8 +243,9 @@ fn runtest(test: &str, cratename: &str, libs: SearchPaths,
|
||||||
if should_panic && out.status.success() {
|
if should_panic && out.status.success() {
|
||||||
panic!("test executable succeeded when it should have failed");
|
panic!("test executable succeeded when it should have failed");
|
||||||
} else if !should_panic && !out.status.success() {
|
} else if !should_panic && !out.status.success() {
|
||||||
panic!("test executable failed:\n{:?}",
|
panic!("test executable failed:\n{}\n{}",
|
||||||
str::from_utf8(&out.stdout));
|
str::from_utf8(&out.stdout).unwrap_or(""),
|
||||||
|
str::from_utf8(&out.stderr).unwrap_or(""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue