From: NeilBrown Date: Tue, 9 Nov 2021 05:05:50 +0000 (+1100) Subject: mark-tested: don't fail if coverage is too low X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=commitdiff_plain;h=002a71e19a00ba60303b3406bfe3e5da3c828f5d mark-tested: don't fail if coverage is too low As the whole point of mark-tested is to help improve coverage, it is silly to rail if coverage is too low. So make it possible to easily skip that test in the Makefile. Signed-off-by: NeilBrown --- diff --git a/csrc/oceani-tests.mdc b/csrc/oceani-tests.mdc index dccfb2a..5d11197 100644 --- a/csrc/oceani-tests.mdc +++ b/csrc/oceani-tests.mdc @@ -78,9 +78,9 @@ arguments separated from the name by commas. For each test, there is a section @for i in coverage/#*.gcda; do mv $$i coverage/$${i##*#}; done @gcov -o coverage oceani.mdc > /dev/null 2> /dev/null @mv *.gcov coverage ; [ -f .gcov ] && mv .gcov coverage || true - @ awk '/NOTEST/ { next } /^ *[1-9]/ {ran+=1} /^ *###/ {skip+=1} \ + @[ -n "$$SKIP_COVERAGE_CHECK" ] || awk '/NOTEST/ { next } /^ *[1-9]/ {ran+=1} /^ *###/ {skip+=1} \ END {printf "coverage: %6.2f%%\n", ran * 100 / (ran + skip); \ - if (ran < (ran + skip) *0.959) exit(1) }' \ + if (ran < (ran + skip) *0.96) exit(1) }' \ coverage/oceani.mdc.gcov @rm -f .tmp* diff --git a/tools/mark-untested b/tools/mark-untested index 1dd8db2..96aeb2c 100755 --- a/tools/mark-untested +++ b/tools/mark-untested @@ -9,7 +9,7 @@ case $1 in * ) rm coverage/*.mdc.gcov - make SKIP_VALGRIND=1 oceani_test_suite || exit 1 + make SKIP_VALGRIND=1 SKIP_COVERAGE_CHECK=1 oceani_test_suite || exit 1 for i in coverage/*.mdc.gcov do b=${i%.gcov}