diff --git a/autotools/gen-coverage b/autotools/gen-coverage index 1324724fb323f6079d90e815d6d37871269b49ba..91bd004c7ba69271272de5aa331c59e69a11082c 100755 --- a/autotools/gen-coverage +++ b/autotools/gen-coverage @@ -19,6 +19,7 @@ # 02110-1301, USA. set -e +set -u : ${COVERAGE:=coverage} : ${PYTHON:=python} @@ -26,10 +27,10 @@ set -e : ${TEXT_COVERAGE:?} : ${GANETI_TEMP_DIR:?} -omit=$($PYTHON -c 'import sys; import os; -print ",".join("%s/" % i for i in set([sys.prefix, sys.exec_prefix, - os.environ["GANETI_TEMP_DIR"] + "/test"]))') -omit="--omit=$omit" +reportargs=( + '--include=*' + '--omit=test/*' + ) $COVERAGE erase @@ -43,13 +44,13 @@ for script; do else cmdprefix= fi - $cmdprefix $COVERAGE run --branch --append $script + $cmdprefix $COVERAGE run --branch --append "${reportargs[@]}" $script done echo "Writing text report to $TEXT_COVERAGE ..." >&2 -$COVERAGE report $omit | tee "$TEXT_COVERAGE" +$COVERAGE report "${reportargs[@]}" | tee "$TEXT_COVERAGE" if [[ -n "$HTML_COVERAGE" ]]; then echo "Generating HTML report in $HTML_COVERAGE ..." >&2 - $COVERAGE html $omit -d "$HTML_COVERAGE" + $COVERAGE html "${reportargs[@]}" -d "$HTML_COVERAGE" fi