forked from tools-alexuser01/font-awesome
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.am
More file actions
71 lines (62 loc) · 1.77 KB
/
Makefile.am
File metadata and controls
71 lines (62 loc) · 1.77 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
69
70
71
AUTOMAKE_OPTIONS = subdir-objects
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4
if TESTS_ENABLED
TESTS_SUBDIR = tests
endif
SUBDIRS = \
src \
$(TESTS_SUBDIR)
gcov_sources = $(unit_tests_SOURCES)
if GCOV_ENABLED
gcov-report.txt: gcov-clean
$(QUIET_GEN)(rm -f $@; \
echo -e "Test coverage for font-awesome:\n" >> $@; \
total_covered=0; total_actual=0; \
for file in $(filter %.cxx,$(gcov_sources)); do \
gcov-4.7 -o .libs/$${file/.c/.gcda} $$file > /dev/null; \
if test -f $$file.gcov; then \
actual=`grep -v ' -:' $$file.gcov | wc -l`; \
uncovered=`grep '#####:' $$file.gcov | wc -l`; \
covered=$$((actual - uncovered)); \
total_covered=$$((total_covered + covered)); \
total_actual=$$((total_actual + actual)); \
echo -e "$$file: \t$$covered / $$actual\t($$((($$covered * 100) / $$actual))%)"; \
fi \
done >> $@; \
cd $(abs_srcdir); \
echo -e "\nSource lines: $$total_actual\nCovered statements: $$total_covered\nTotal coverage: $$((($$total_covered * 100) / $$total_actual))%" >> $@)
gcov: gcov-report.txt
@echo ""; cat gcov-report.txt
cov:
@make gcov-report
gcov-report:
@mkdir -p coverage
@lcov --compat-libtool --directory . --capture --output-file coverage/app.info
@lcov --extract coverage/app.info */src/* --output-file coverage/local.info
@genhtml -o coverage/ coverage/local.info
gcov-reset:
@rm -fr coverage
@find . -name "*.gcda" -exec rm {} \;
@lcov --directory . --zerocounters
gcov-clean:
@find . -name "*.gcda" -o -name "*.gcov" -delete
clean-local:
@make gcov-reset
check:
@make test
@make cov
else
gcov-report.txt:
@true
cov-reset:
@true
gcov-clean:
@true
cov:
@echo "Code coverage not enabled"
gcov:
@echo "Need to reconfigure with --enable-gcov"
endif # GCOV_ENABLED
test:
@sh ./run-unit-tests.sh
.PHONY: gcov gcov-clean gcov-report.txt