Code

Added the SysDB homepage to all manpages.
[sysdb.git] / t / coverage.sh
index 460089753a9d75f733118e26592e205b9b87841a..a689b571156166dc7a90bb972d7817153d23a4d9 100755 (executable)
@@ -38,25 +38,30 @@ if test -d "$srcdir"/.git/; then
        cp -a "$srcdir"/.git .
 
        # reset all files which are not part of the tarball
-       # (e.g. .gitignore, .travis.yml which would else cause a "dirty" version)
-       git reset --hard
+       git checkout HEAD .gitignore .travis.yml t/cibuild.sh
 fi
 
-./configure --enable-gcov --disable-shared CFLAGS="-O0 -g"
-make
+# rebuild build system to refresh version number, etc.
+rm -f version
+touch configure.ac && make configure
 
-V1=$( grep '^PACKAGE_VERSION' Makefile | cut -d' ' -f3 )
-if test -z "$V1"; then
-       # this should not happen
-       V1="$V"
-fi
+./configure --enable-gcov CFLAGS="-O0 -g"
+make
 
 lcov --base-directory src --directory src --zerocount
-make test
+make test || (status=$?; cat t/test-suite.log 2> /dev/null; exit $status)
+
+# old versions of lcov don't support --no-external
 lcov --base-directory src --directory src --no-external \
-       --capture -o sysdb_coverage.info
+       --capture -o sysdb_coverage.info \
+       || lcov --base-directory src --directory src \
+               --capture -o sysdb_coverage.info
+for pattern in '*.y' '*.l'; do
+       lcov --remove sysdb_coverage.info "$pattern" -o sysdb_coverage.info
+done
 
+V=$( ./version-gen.sh )
 genhtml -o "$srcdir"/t/coverage \
-       -t "SysDB $V1 test coverage" --num-spaces=4 --legend \
+       -t "SysDB $V test coverage" --num-spaces=4 --legend \
        sysdb_coverage.info