summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2010-04-09 16:25:32 +0000
committerMorgan Deters <mdeters@gmail.com>2010-04-09 16:25:32 +0000
commite390a4207d3858927354b3d4b40d540c00f8064c (patch)
tree589fd13ed8f6ba835cd79a2894092860b66b7696 /Makefile.am
parentc3a6ff8c6e4a0c743cd33eb29931f837eeb2959e (diff)
added experimental "make lcov" target (it runs only unit tests); better coverage for util and context classes; implemented some output functionality that was missing; reclassified some tests white -> black or black -> public; other minor fixes
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am45
1 files changed, 45 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 5aec4e904..c10bc1263 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -11,3 +11,48 @@ SUBDIRS = src test contrib
regress0 regress1 regress2 regress3: all
(cd test && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1
+LCOV = lcov
+GENHTML = genhtml
+
+LCOV_EXCLUDES = \
+ "$(CXXTEST)/*" \
+ "/usr/include/*" \
+ "$(abs_top_builddir)/test/*"
+
+# lcov 1.7 has some bugs that we have to work around (can't do
+# baseline measurement, merge between different test-names doesn't
+# work...)
+.PHONY: lcov
+lcov: all
+ $(LCOV) -z -d .
+ $(MAKE) check -C test/unit
+ $(LCOV) -c -d . -t cvc4_units -o cvc4-coverage-full.info
+ $(LCOV) -o cvc4-coverage.info -r cvc4-coverage-full.info $(LCOV_EXCLUDES)
+ mkdir -p "@top_srcdir@/html"
+ $(GENHTML) -o "@top_srcdir@/html" cvc4-coverage.info
+ @echo "De-mangling C++ symbols..."
+ @find "@top_srcdir@/html" -name '*.func.html' | \
+ xargs perl -pi -e 's#(<td class="coverFn"><a href=".*">)(.*)(</a></td>)#$$_=`c++filt "$$2"`;chomp;print "$$1<xmp>$$_</xmp>$$3\n";#e'
+
+# when we get a working lcov, we can do better stats for
+# modules/test-types; unfortunately lcov 1.8 directory paths
+# are broken(?) or at least different than 1.7
+.PHONY: lcov18
+lcov18: all
+ @for testtype in public black white; do \
+ echo; echo "=== Collecting coverage data from $$testtype unit tests ==="; \
+ echo $(LCOV) -z -d .; \
+ $(LCOV) -z -d . || exit 1; \
+ echo $(MAKE) check -C test/unit TEST_SUFFIX=_$$testtype || exit 1; \
+ $(MAKE) check -C test/unit TEST_SUFFIX=_$$testtype || exit 1; \
+ echo $(LCOV) -c -d . -t $$testtype -o cvc4-coverage-$$testtype-full.info || exit 1; \
+ $(LCOV) -c -d . -t $$testtype -o cvc4-coverage-$$testtype-full.info || exit 1; \
+ echo $(LCOV) -o cvc4-coverage-$$testtype.info -r cvc4-coverage-$$testtype-full.info $(LCOV_EXCLUDES); \
+ $(LCOV) -o cvc4-coverage-$$testtype.info -r cvc4-coverage-$$testtype-full.info $(LCOV_EXCLUDES) || exit 1; \
+ echo; \
+ done
+ mkdir -p "@top_srcdir@/html"
+ $(GENHTML) -o "@top_srcdir@/html" cvc4-coverage-public.info cvc4-coverage-black.info cvc4-coverage-white.info
+ @echo "De-mangling C++ symbols..."
+ @find "@top_srcdir@/html" -name '*.func.html' | \
+ xargs perl -pi -e 's,(<td class="coverFn"><a href=".*">)(.*)(</a></td>),$$_=`c++filt "$$2"`;chomp;print "$$1<xmp>$$_</xmp>$$3";,e'
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback