summaryrefslogtreecommitdiff
path: root/regress-driver
diff options
context:
space:
mode:
authorFred Wright <fw@fwright.net>2016-03-15 16:52:09 -0700
committerEric S. Raymond <esr@thyrsus.com>2016-03-15 20:31:21 -0400
commit45d873ea3a6e2122900d2b785b7cd131a7759569 (patch)
treefcf4ec267deb74a759262d38a96aff009671d2af /regress-driver
parent1829ba9c5106340b83be4a6dc5d69b37421bc98c (diff)
downloadgpsd-45d873ea3a6e2122900d2b785b7cd131a7759569.tar.gz
Adds support for Python coveraging.
This extends the "coveraging" option to apply coveraging to any Python programs executed during the build. It adds a new option "python_coverage" to allow configuring the command to be used for applying coveraging to Python programs, with a default value of "coverage run" (which is typically appropriate, provided that the coverage package is installed). Setting this to the null string disables Python coveraging. If "python_coverage" has its default value and parallel builds are enabled, "--parallel-mode" is automatically appended to the coverage command. If a non-default coverage command is used, it's the user's responsibility to handle parallelism appropriately. Note that this does not apply coveraging to generated Python code. This also adds the coverage result files to .gitignore, including the C coverage files which weren't there previously. TESTED: Ran "scons check" as well as sample cases of regress-driver -b and -v, both with and without coveraging. Also verified that it works with the full path to the tool supplied as the python_coverage option.
Diffstat (limited to 'regress-driver')
-rwxr-xr-xregress-driver6
1 files changed, 3 insertions, 3 deletions
diff --git a/regress-driver b/regress-driver
index e64bc304..0ca349bc 100755
--- a/regress-driver
+++ b/regress-driver
@@ -129,7 +129,7 @@ case $mode in
then
trap 'rm -f ${TMP}/test-$$.chk; exit $errors' EXIT HUP INT TERM
case $testing in
- daemon) TMPDIR=${TMP} ${PYTHON} ${GPSD_HOME}/gpsfake -s 38400 -1 -p $opts ${f} | ${GPSFILTER} ${ALTFILTER} >${TMP}/test-$$.chk ;;
+ daemon) TMPDIR=${TMP} ${PYTHON} ${PYTHON_COVERAGE} ${GPSD_HOME}/gpsfake -s 38400 -1 -p $opts ${f} | ${GPSFILTER} ${ALTFILTER} >${TMP}/test-$$.chk ;;
clientlib) ${GPSD_HOME}/test_libgps -b <${f} >${TMP}/test-$$.chk ;;
esac
if [ "${ALTFILTER}" ]
@@ -185,7 +185,7 @@ case $mode in
[ $quiet = true ] || echo "Rebuilding $testing regressions..." >&2
for f in $*; do
case $testing in
- daemon) ${PYTHON} ${GPSD_HOME}/gpsfake -s 38400 -1 -p $opts ${f} | ${GPSFILTER} >${f}.chk;;
+ daemon) ${PYTHON} ${PYTHON_COVERAGE} ${GPSD_HOME}/gpsfake -s 38400 -1 -p $opts ${f} | ${GPSFILTER} >${f}.chk;;
clientlib) ${GPSD_HOME}/test_libgps -b <${f} >${f}.chk ;;
esac
done
@@ -195,7 +195,7 @@ case $mode in
[ $quiet = true ] || echo "Viewing..." >&2
for f in $*; do
case $testing in
- daemon) ${PYTHON} ${GPSD_HOME}/gpsfake -s 38400 -1 -p $opts ${f} | ${GPSFILTER} ;;
+ daemon) ${PYTHON} ${PYTHON_COVERAGE} ${GPSD_HOME}/gpsfake -s 38400 -1 -p $opts ${f} | ${GPSFILTER} ;;
clientlib) ${GPSD_HOME}/libgps -b <${f} ;;
esac
done