Skip to content

Commit

Permalink
run_tests.sh: re-assign exit codes
Browse files Browse the repository at this point in the history
This leaves run_tests_parallel.sh unchanged.
  • Loading branch information
neuschaefer authored and radare committed Aug 10, 2014
1 parent 375575c commit a221da8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ Exit code
run_tests.sh exits with the following exit codes:

* 0: all tests passed
* 1: at least one test failed
* 2: no tests failed, but there was at least one broken test
* 3: no tests failed or are broken, but there is at least one fixed test
* 1: at least one essential test failed
* 2: no essential tests, but at least one regular one failed
* 3: no tests failed, but there was at least one broken test
* 4: no tests failed or are broken, but there is at least one fixed test

Reporting Radare2 Bugs
----------------------
Expand Down
15 changes: 9 additions & 6 deletions run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,16 @@ echo "$V,${TESTS_SUCCESS},${TESTS_FIXED},${TESTS_BROKEN},${TESTS_FAILED},${TESTS
sort .stats.csv > stats.csv
rm -f .stats.csv

# Proper exit code.
# Exit codes, as documented in README.md
if [ "${TESTS_FATAL}" -gt 0 ]; then
echo "ESSENTIAL TEST HAS FAILED"
exit 2
fi

if [ "${TESTS_FAILED}" -gt 0 ]; then
exit 1
elif [ "${TESTS_FAILED}" -gt 0 ]; then
exit 2
elif [ "${TESTS_BROKEN}" -gt 0 ]; then
exit 3
elif [ "${TESTS_FIXED}" -gt 0 ]; then
exit 4
else
exit 0
fi
exit 0

0 comments on commit a221da8

Please sign in to comment.