Commit da775218 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

gen-coverage: Change filter



It is not necessary to run a Python script to generate the filter, which
didn't work very well anyway on systems with modules in
/usr/share/pyshared.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 7e6b6f1f
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment