From bbc0f64fa57f8af38bf961bc78b2a8fc984e666a Mon Sep 17 00:00:00 2001 From: Niels Date: Wed, 11 Dec 2013 10:23:31 +0100 Subject: [PATCH] a Makefile target for test coverage --- Makefile.am | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 4144f338..158413ca 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,5 +10,12 @@ json98_CXXFLAGS = -std=c++98 json98_CPPFLAGS = -I$(top_srcdir)/src svn-clean: maintainer-clean - rm -fr configure INSTALL aclocal.m4 build-aux depcomp install-sh missing test-driver + rm -fr configure INSTALL aclocal.m4 build-aux depcomp install-sh missing test-driver cover_html *.gcda *.gcno coverage*.info for DIR in $(DIST_SUBDIRS) .; do rm -f $$DIR/Makefile.in; done + +cover: + make clean + make json98 CXXFLAGS+="--coverage -g -fprofile-arcs -ftest-coverage" CPPFLAGS+="-DNDEBUG" + ./json98 + lcov --capture --directory . --output-file coverage98.info + genhtml coverage*.info --output-directory cover_html --show-details --title "$(PACKAGE_STRING)" --legend --demangle-cpp