Skip to content

Commit 6fed9e5

Browse files
authored
Merge pull request #1313 from guswynn/master
collect all test failures before failing
2 parents 146bea4 + fd59dc7 commit 6fed9e5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/book/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ impl MDBook {
250250
// Index Preprocessor is disabled so that chapter paths continue to point to the
251251
// actual markdown files.
252252

253+
let mut failed = false;
253254
for item in book.iter() {
254255
if let BookItem::Chapter(ref ch) = *item {
255256
let chapter_path = match ch.path {
@@ -282,7 +283,8 @@ impl MDBook {
282283
let output = cmd.output()?;
283284

284285
if !output.status.success() {
285-
bail!(
286+
failed = true;
287+
error!(
286288
"rustdoc returned an error:\n\
287289
\n--- stdout\n{}\n--- stderr\n{}",
288290
String::from_utf8_lossy(&output.stdout),
@@ -291,6 +293,9 @@ impl MDBook {
291293
}
292294
}
293295
}
296+
if failed {
297+
bail!("One or more tests failed");
298+
}
294299
Ok(())
295300
}
296301

0 commit comments

Comments
 (0)