summaryrefslogtreecommitdiff
path: root/build/Makefile.gcov
blob: 944739aff3309f4f2670544f6bfc66687099291f (plain)
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
#
# LCOV
#

LTP = lcov
LTP_GENHTML = genhtml

lcov: lcov-html

lcov-test: lcov-clean-data test

php_lcov.info: lcov-test
	@echo "Generating lcov data for $@"
	@$(LTP) --capture --no-external --directory . --output-file $@
	@echo "Stripping bundled libraries from $@"
	@$(LTP) --remove $@ \
		'*/<stdout>' \
		'$(top_srcdir)/ext/bcmath/libbcmath/*' \
		'$(top_srcdir)/ext/date/lib/*' \
		'$(top_srcdir)/ext/fileinfo/libmagic/*' \
		'$(top_srcdir)/ext/gd/libgd/*' \
		'$(top_srcdir)/ext/hash/sha3/*' \
		'$(top_srcdir)/ext/mbstring/libmbfl/*' \
		'$(top_srcdir)/ext/opcache/jit/libudis86/*' \
		'$(top_srcdir)/ext/pcre/pcre2lib/*' \
		'$(top_srcdir)/ext/xmlrpc/libxmlrpc/*' \
		--output-file $@

lcov-html: php_lcov.info
	@echo "Generating lcov HTML"
	@$(LTP_GENHTML) --legend --output-directory lcov_html/ --title "PHP Code Coverage" php_lcov.info

lcov-clean:
	rm -f php_lcov.info
	rm -rf lcov_html/

lcov-clean-data:
	@find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f