From 1826bb12bf96617dbfebf9ed4b19de29cf4c2f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Sat, 3 Oct 2015 14:30:24 +0000 Subject: [PATCH] Modify the coverage build script so that it only runs "make clean" if coverage was not already enabled when the script was started. --- tools/coverage.sh.in | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/tools/coverage.sh.in b/tools/coverage.sh.in index b7cbb73..2fa92ba 100755 --- a/tools/coverage.sh.in +++ b/tools/coverage.sh.in @@ -16,11 +16,25 @@ while getopts "j:" opt ; do esac done +if cov01 -sq >/dev/null ; then + cov=true +else + cov=false +fi + srcdir="@abs_top_srcdir@" +htmldir="${srcdir}/cov" export COVFILE="${srcdir}/test.cov" -gmake -C "${srcdir}" clean -find "${srcdir}" -type f -name "${COVFILE##*/}" -delete -cov01 -1 -gmake -C "${srcdir}" $j check || exit 1 -cov01 -0 -gmake -C "${srcdir}" clean +if ! $cov ; then + # Rebuild with coverage enabled + gmake -C "${srcdir}" clean + cov01 -1 +fi +covclear +gmake -C "${srcdir}" $j check +covhtml "${htmldir}" +if ! $cov ; then + # Clean up + cov01 -0 + gmake -C "${srcdir}" clean +fi