about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorray glover <ray@rayglover.net>2015-03-30 17:59:28 +0100
committerray glover <ray@rayglover.net>2015-03-30 23:42:41 +0100
commit5dc23be5b1b5da1fc255e0b3aafbefbdffb2b10e (patch)
tree5a6a2d3bb018b4e694eedb1c0882db13aa93b378 /src
parentc5370be36ec6601c4a816f0341d1acd81e08d345 (diff)
downloadrust-5dc23be5b1b5da1fc255e0b3aafbefbdffb2b10e.tar.gz
rust-5dc23be5b1b5da1fc255e0b3aafbefbdffb2b10e.zip
rustdoc: output stderr on doc-test fail
Forward output from stderr when a test executable panics/fails.
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/test.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs
index 702a32be586..babbe15b17d 100644
--- a/src/librustdoc/test.rs
+++ b/src/librustdoc/test.rs
@@ -243,8 +243,9 @@ fn runtest(test: &str, cratename: &str, libs: SearchPaths,
             if should_panic && out.status.success() {
                 panic!("test executable succeeded when it should have failed");
             } else if !should_panic && !out.status.success() {
-                panic!("test executable failed:\n{:?}",
-                      str::from_utf8(&out.stdout));
+                panic!("test executable failed:\n{}\n{}",
+                       str::from_utf8(&out.stdout).unwrap_or(""),
+                       str::from_utf8(&out.stderr).unwrap_or(""));
             }
         }
     }