sys/embunit: fix return value on failure #21468
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.
Contribution description
When using
OUTPUT=COLORTEST
the return value of the unit test'smain()
on failure was0
, while it should be1
. As a result, running the unit tests from a script usingwould not catch a test failure.
This commit changes the behavior so that
0
is returned on success and1
on failure for both regular and colored text output.Testing procedure
Run
and
The former will fail, the latter succeed. But both will have an exit code of
0
(echo $?
) inmaster
, while ommitting theOUTPUT=COLORTEXT
will cause the failed test to have an exit code of1
.With this PR, failures will have an exit code of
1
and success an exit code of0
, regardless of output.Issues/PRs references
None