From 20231d774bcda2d6f9bd52fe402fd22f2d22d223 Mon Sep 17 00:00:00 2001 From: kennytm Date: Tue, 3 Jul 2018 05:53:18 +0800 Subject: [PATCH] Fixed detection of test-fail for doctests. --- src/bootstrap/test.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 90688b1c0e181..3adfbb5e36b51 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); + } } }