summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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'"