Add summary field to OpNodeModifyStorage
[ganeti-local] / autotools / gen-coverage
index 1324724..91bd004 100755 (executable)
@@ -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