From 5ea8e55aeaa4a433af25f1770f1029f20e32ba59 Mon Sep 17 00:00:00 2001 From: Gus Wynn Date: Thu, 3 Sep 2020 18:36:51 -0700 Subject: [PATCH 1/2] collect all test failures before failing --- src/book/mod.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/book/mod.rs b/src/book/mod.rs index 71f0197f..46ad5a9c 100644 --- a/src/book/mod.rs +++ b/src/book/mod.rs @@ -250,6 +250,7 @@ impl MDBook { // Index Preprocessor is disabled so that chapter paths continue to point to the // actual markdown files. + let mut failed = false; for item in book.iter() { if let BookItem::Chapter(ref ch) = *item { let chapter_path = match ch.path { @@ -282,7 +283,8 @@ impl MDBook { let output = cmd.output()?; if !output.status.success() { - bail!( + failed = true; + error!( "rustdoc returned an error:\n\ \n--- stdout\n{}\n--- stderr\n{}", String::from_utf8_lossy(&output.stdout), @@ -291,6 +293,9 @@ impl MDBook { } } } + if failed { + bail!("One of more tests failed"); + } Ok(()) } From fd59dc73e5071cbda5e6b94f36b0b611aa8daa0e Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sun, 6 Sep 2020 09:11:53 -0700 Subject: [PATCH 2/2] Adjust wording --- src/book/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/book/mod.rs b/src/book/mod.rs index 46ad5a9c..0723578f 100644 --- a/src/book/mod.rs +++ b/src/book/mod.rs @@ -294,7 +294,7 @@ impl MDBook { } } if failed { - bail!("One of more tests failed"); + bail!("One or more tests failed"); } Ok(()) }