summaryrefslogtreecommitdiff
path: root/fuzz/view-coverage.sh
diff options
context:
space:
mode:
authorTim Rühsen <tim.ruehsen@gmx.de>2018-03-03 18:42:20 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2018-03-04 17:58:38 +0000
commit7b800ea02745df2e40e9f8b09d152902f8abcb4a (patch)
treefd6d42ee3178ea8265dd68fb4e5ae9f80835a61a /fuzz/view-coverage.sh
parentc8d7f94b1a9dab8b97b3277eed8a052adcb89689 (diff)
downloadgnutls-7b800ea02745df2e40e9f8b09d152902f8abcb4a.tar.gz
Improve fuzzer coverage report creation
Diffstat (limited to 'fuzz/view-coverage.sh')
-rwxr-xr-xfuzz/view-coverage.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/fuzz/view-coverage.sh b/fuzz/view-coverage.sh
index 9461ba6468..7d50960541 100755
--- a/fuzz/view-coverage.sh
+++ b/fuzz/view-coverage.sh
@@ -1,10 +1,10 @@
-#!/bin/bash -eu
+#!/bin/bash -e
#
-# (C)2017 Tim Ruehsen tim.ruehsen@gmx.de
+# (C)2017-2018 Tim Ruehsen tim.ruehsen@gmx.de
#
# View the coverage report for one or more fuzzers.
-# 1. execute 'make coverage' in the fuzz/ directory
+# 1. execute 'make coverage-prepare' in the fuzz/ directory
# 2. execute './view-coverage.sh <fuzz target(s)>
# Example with single fuzzer:
@@ -20,9 +20,11 @@ if test -z "$1"; then
fi
LCOV_INFO=coverage.info
+
lcov --zerocounters --directory ../lib/
-lcov --capture --initial --directory ../lib/.libs --directory . --output-file $LCOV_INFO
-make check TESTS="$*" CFLAGS="$(CFLAGS) --coverage" LDFLAGS="$(LDFLAGS) --coverage"
-lcov --capture --directory ../lib/.libs --output-file $LCOV_INFO
+#lcov --capture --initial --directory ../lib/ --directory . --output-file $LCOV_INFO
+make check TESTS="$*" CFLAGS="$CFLAGS --coverage" LDFLAGS="$LDFLAGS --coverage"
+lcov --capture --directory ../lib/ --output-file $LCOV_INFO
+lcov --remove $LCOV_INFO '/usr/include*' '*/gl/*' -o $LCOV_INFO
genhtml --prefix . --ignore-errors source $LCOV_INFO --legend --title "$*" --output-directory=lcov
xdg-open lcov/index.html