Skip to content

Commit

Permalink
Merge pull request #1313 from guswynn/master
Browse files Browse the repository at this point in the history
collect all test failures before failing
  • Loading branch information
ehuss authored Sep 6, 2020
2 parents 146bea4 + fd59dc7 commit 6fed9e5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/book/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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),
Expand All @@ -291,6 +293,9 @@ impl MDBook {
}
}
}
if failed {
bail!("One or more tests failed");
}
Ok(())
}

Expand Down

0 comments on commit 6fed9e5

Please sign in to comment.