]> git.lizzy.rs Git - rust.git/commitdiff
rustdoc: output stderr on doc-test fail
authorray glover <ray@rayglover.net>
Mon, 30 Mar 2015 16:59:28 +0000 (17:59 +0100)
committerray glover <ray@rayglover.net>
Mon, 30 Mar 2015 22:42:41 +0000 (23:42 +0100)
Forward output from stderr when a test executable panics/fails.

src/librustdoc/test.rs

index 702a32be58684af5a56c7529dc570934628c8c27..babbe15b17df51ad1beeaa06f6540f6c2c951e74 100644 (file)
@@ -243,8 +243,9 @@ fn drop(&mut self) {
             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(""));
             }
         }
     }