Exit with a nonzero status if we get an error #161
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A branch of the book had a code example that failed with
mdbook test
, but travis reported a success. This is because the exit status ofmdbook test
(and other commands) is still 0 even when there are errors.I made a little repo that has an example to test with, but the book-example in this repo also currently has an error with
mdbook test
😱Before this patch, if I run
mdbook test
on those, I get an exit status of 0 when I expect to get nonzero. After this patch, I get the nonzero exit status that I expected (I went with 101 because that's whatrustdoc --test
returns if it fails), and I continue to get an exit status of 0 when runningmdbook test
on a book that passes its tests.This does affect all commands. I'm not sure if others were already exiting as expected when encountering errors or not. It looks like
watch
might.I didn't see any automated tests that actually run the binaries-- please point me to the appropriate place to add tests if I missed them!