57e9e3af2faa83d01beb1f2ebb036ccc25322b50
[cvc5.git] / Makefile.am
1 include $(top_srcdir)/config/doxygen.am
2
3 AM_CXXFLAGS = -Wall
4
5 AUTOMAKE_OPTIONS = foreign
6 ACLOCAL_AMFLAGS = -I config
7
8 SUBDIRS = src test contrib
9
10 .PHONY: regress0 regress1 regress2 regress3
11 regress0 regress1 regress2 regress3: all
12 (cd test && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1
13
14 LCOV = lcov
15 GENHTML = genhtml
16
17 LCOV_EXCLUDES = \
18 "$(CXXTEST)/*" \
19 "/usr/include/*" \
20 "$(abs_top_builddir)/test/*"
21
22 # lcov 1.7 has some bugs that we have to work around (can't do
23 # baseline measurement, merge between different test-names doesn't
24 # work...)
25 .PHONY: lcov
26 lcov: all
27 $(LCOV) -z -d .
28 $(MAKE) check -C test/unit
29 $(LCOV) -c -d . -t cvc4_units -o cvc4-coverage-full.info
30 $(LCOV) -o cvc4-coverage.info -r cvc4-coverage-full.info $(LCOV_EXCLUDES)
31 mkdir -p "@top_srcdir@/html"
32 $(GENHTML) -o "@top_srcdir@/html" cvc4-coverage.info
33 @echo "De-mangling C++ symbols..."
34 @find "@top_srcdir@/html" -name '*.func.html' | \
35 xargs perl -pi -e 's#(<td class="coverFn"><a href=".*">)(.*)(</a></td>)#$$_=`c++filt "$$2"`;chomp;print "$$1<xmp>$$_</xmp>$$3\n";#e'
36
37 # when we get a working lcov, we can do better stats for
38 # modules/test-types; unfortunately lcov 1.8 directory paths
39 # are broken(?) or at least different than 1.7
40 .PHONY: lcov18
41 lcov18: all
42 @for testtype in public black white; do \
43 echo; echo "=== Collecting coverage data from $$testtype unit tests ==="; \
44 echo $(LCOV) -z -d .; \
45 $(LCOV) -z -d . || exit 1; \
46 echo $(MAKE) check -C test/unit TEST_SUFFIX=_$$testtype || exit 1; \
47 $(MAKE) check -C test/unit TEST_SUFFIX=_$$testtype || exit 1; \
48 echo $(LCOV) -c -d . -t $$testtype -o cvc4-coverage-$$testtype-full.info || exit 1; \
49 $(LCOV) -c -d . -t $$testtype -o cvc4-coverage-$$testtype-full.info || exit 1; \
50 echo $(LCOV) -o cvc4-coverage-$$testtype.info -r cvc4-coverage-$$testtype-full.info $(LCOV_EXCLUDES); \
51 $(LCOV) -o cvc4-coverage-$$testtype.info -r cvc4-coverage-$$testtype-full.info $(LCOV_EXCLUDES) || exit 1; \
52 echo; \
53 done
54 mkdir -p "@top_srcdir@/html"
55 $(GENHTML) -o "@top_srcdir@/html" cvc4-coverage-public.info cvc4-coverage-black.info cvc4-coverage-white.info
56 @echo "De-mangling C++ symbols..."
57 @find "@top_srcdir@/html" -name '*.func.html' | \
58 xargs perl -ni -e 's,(<td class="coverFn"><a href=".*">)(.*)(</a></td>.*),$$_=`c++filt "$$2"`;chomp;print "$$1<xmp>$$_</xmp>$$3\n";,e || print'