about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-07-03 05:53:18 +0800
committerkennytm <kennytm@gmail.com>2018-07-03 05:53:18 +0800
commit20231d774bcda2d6f9bd52fe402fd22f2d22d223 (patch)
treee254a6c50ac2077333ea23d6737517146ac38551 /src/bootstrap
parentd91457495b2f551e34ecbe1111885d6ccceceb15 (diff)
downloadrust-20231d774bcda2d6f9bd52fe402fd22f2d22d223.tar.gz
rust-20231d774bcda2d6f9bd52fe402fd22f2d22d223.zip
Fixed detection of test-fail for doctests.
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/test.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index 90688b1c0e1..3adfbb5e36b 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -1269,17 +1269,15 @@ impl Step for DocTest {
 
         files.sort();
 
+        let mut toolstate = ToolState::TestPass;
         for file in files {
-            let test_result = markdown_test(builder, compiler, &file);
-            if self.is_ext_doc {
-                let toolstate = if test_result {
-                    ToolState::TestPass
-                } else {
-                    ToolState::TestFail
-                };
-                builder.save_toolstate(self.name, toolstate);
+            if !markdown_test(builder, compiler, &file) {
+                toolstate = ToolState::TestFail;
             }
         }
+        if self.is_ext_doc {
+            builder.save_toolstate(self.name, toolstate);
+        }
     }
 }