Code

frontend/query_test: Test various QUERY functions.
[sysdb.git] / t / coverage.sh
index 8be94cf6e6bac9394a06b0066498206506af9d37..d896156bf1f4bddbd14a23ef6c58f560d655c977 100755 (executable)
@@ -38,24 +38,34 @@ if test -d "$srcdir"/.git/; then
        cp -a "$srcdir"/.git .
 
        # reset all files which are not part of the tarball
-       git checkout HEAD .gitignore .travis.yml
+       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 -j10 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' \
+               'sysdb/scanner.c' 'frontend/scanner.c' 'liboconfig/scanner.c' \
+               'parser/scanner.c' 'frontend/grammar.c' 'parser/grammar.c' \
+               'liboconfig/parser.c'
+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