Makefile.am
1.69 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
57
58
59
60
61
62
63
64
65
66
67
68
ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = subdir-objects
if IS_AMD
else
TESTS_ENVIRONMENT = valgrind \
--error-exitcode=123 \
--leak-check=full \
--suppressions=./suppress/external.supp \
--quiet
endif
TESTS = classTest
check_PROGRAMS = classTest
COMMON = runtest.c
CLASS = $(COMMON) \
../src/interface.c \
../src/i_class.c \
../src/memory.c \
mock/mock_class.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
classTest_SOURCES = $(CLASS) classTest.c
classTest_CFLAGS = $(AM_CFLAGS) -pg
classTest_LDFLAGS = $(AM_LDFLAGS) -pg
EXTRA_DIST = runtest.h mock 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 $(PWD) \
--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