summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Rühsen <tim.ruehsen@gmx.de>2017-08-11 21:42:02 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-08-16 15:00:13 +0200
commit569c81c266cebb27442ceb9aaab6a62030ff42a8 (patch)
tree6fed78aa97fd556f588f3e57e87138916333ef36
parent7e920217e51a77a4e2dc4a9dbd739b3b7f839729 (diff)
downloadgnutls-569c81c266cebb27442ceb9aaab6a62030ff42a8.tar.gz
fuzzer: Add 'make -C fuzz coverage' [ci skip]
This reports how much code is covered by fuzzing. Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
-rw-r--r--fuzz/Makefile.am16
1 files changed, 16 insertions, 0 deletions
diff --git a/fuzz/Makefile.am b/fuzz/Makefile.am
index b747fe0f82..3aa5b2a83f 100644
--- a/fuzz/Makefile.am
+++ b/fuzz/Makefile.am
@@ -83,3 +83,19 @@ oss-fuzz:
fi
.PHONY: oss-fuzz
+
+LCOV_INFO=coverage.info
+clean-lcov:
+ rm -rf $(LCOV_INFO) ../*/*.gc?? ../*/.libs/*.gc?? lcov/
+ lcov --zerocounters --directory ../lib/
+
+coverage: clean clean-lcov
+ $(MAKE) -C .. clean
+ $(MAKE) -C ../gl
+ $(MAKE) -C ../lib CFLAGS="$(CFLAGS) --coverage" LDFLAGS="$(LDFLAGS) --coverage"
+ $(MAKE) check CFLAGS="$(CFLAGS) --coverage" LDFLAGS="$(LDFLAGS) --coverage"
+ lcov --capture --initial --directory ../lib/.libs --output-file $(LCOV_INFO)
+ lcov --capture --directory ../lib/.libs --output-file $(LCOV_INFO)
+ genhtml --prefix . --ignore-errors source $(LCOV_INFO) --legend --title "gnutls-fuzz" --output-directory=lcov
+ @echo
+ @echo "You can now view the coverage report with 'xdg-open lcov/index.html'"