diff --git a/README.md b/README.md index 84062a5b..5a00d12b 100644 --- a/README.md +++ b/README.md @@ -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 ---------------------- diff --git a/run_tests.sh b/run_tests.sh index 628ce08c..6adc2e5a 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -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