From d5ed1f4964432112abf2a2caa0d5a73b1ce9b839 Mon Sep 17 00:00:00 2001 From: Jeremy Grosser Date: Mon, 18 Dec 2023 17:34:54 -0800 Subject: [PATCH] Fix pass/fail reporting in coverage script --- tests/coverage.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/coverage.sh b/tests/coverage.sh index ac8e90e..a7cee99 100755 --- a/tests/coverage.sh +++ b/tests/coverage.sh @@ -49,4 +49,12 @@ COVERAGE_FLAGS=" \ gnatcov coverage --annotate=xcov+ ${COVERAGE_FLAGS} gnatcov coverage --annotate=html+ ${COVERAGE_FLAGS} -echo "PASS" 1>&2 + +let ok=$(grep --text '^FAIL ' coverage.log | wc -l) +let failed=$(grep --text '^FAIL ' coverage.log | wc -l) +let errors=$(grep --text '^ERROR ' coverage.log | wc -l) +if [ $ok -gt 0 -a $failed -eq 0 -a $errors -eq 0 ]; then + echo "PASS" 1>&2 +else + echo "FAIL" 1>&2 +fi