Makefile.am
1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = subdir-objects
TESTS_ENVIRONMENT = valgrind \
--error-exitcode=123 \
--leak-check=full \
--suppressions=./suppress/external.supp \
--quiet
TESTS =
check_PROGRAMS =
COMMON = runtest.c
AM_CFLAGS += -O0 -Wall -Werror -ggdb -I ../include -I .. -I . $(MEM_OPT_FLAGS)
AM_LDFLAGS =
if HAVE_GCOV
AM_CFLAGS += $(COVERAGE_CFLAGS)
AM_LDFLAGS += $(COVERAGE_LDFLAGS)
endif
EXTRA_DIST = runtest.h suppress
if HAVE_GCOV
.PHONY: clean-gcda clean-gcno coverage-html clean-coverage
cov_dir = $(top_srcdir)/tests/coverage/$(PACKAGE_VERSION)
coverage-html: clean clean-coverage check
@echo Collecting coverage data
$(LCOV) -d $(top_srcdir) -c -i -o coverage.base
$(LCOV) -d $(top_srcdir) -c -o coverage.run --gcov-tool /usr/bin/gcov
$(LCOV) -d $(top_srcdir) \
-a ./coverage.base -a ./coverage.run \
-o coverage.info
LANG=C $(GENHTML) --prefix $(top_srcdir) \
--output-directory $(cov_dir) \
--title "$(PACKAGE_NAME) $(PACKAGE_VERSION)" \
--legend --branch-coverage --show-details coverage.run
clean-coverage: clean-gcda clean-gcno
$(LCOV) -d $(top_srcdir) -z
-rm -rf coverage.info coverage.base coverage.run $(cov_dir)
clean-gcda:
@echo Removing old coverage results
-find $(top_srcdir) -name '*.gcda' -print | xargs -r rm
clean-gcno:
@echo Removing old coverage results
-find $(top_srcdir) -name '*.gcno' -print | xargs -r rm
clean-local: clean-coverage
endif # HAVE_GCOV