Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 62 lines (54 sloc) 1.951 kb
30dc899 MFH: - Added --enable-gcov configure option to enable C-level code cover...
foobar authored
1
2 #
3 # LCOV
4 #
5
6 lcov: lcov-html
7
64ab802 @patrickallaert - Fixed bug #52019 (make lcov doesn't support TESTS variable anymore)
patrickallaert authored
8 lcov-test: lcov-clean-data test
30dc899 MFH: - Added --enable-gcov configure option to enable C-level code cover...
foobar authored
9
10 php_lcov.info: lcov-test
11 @echo "Generating data for $@"
12 @rm -rf lcov_data/
13 @$(mkinstalldirs) lcov_data/
14 @echo
618e623 fix lcov processing with gcc 4.1 (some .h files were not copied)
Nuno Lopes authored
15 -@find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.h | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | uniq | while read x; do \
30dc899 MFH: - Added --enable-gcov configure option to enable C-level code cover...
foobar authored
16 echo -n . ;\
b01f5b3 Fixed gcov for generated files
Ilia Alshanetsky authored
17 y=`echo $$x | sed -e 's!\.libs/!!'`; \
30dc899 MFH: - Added --enable-gcov configure option to enable C-level code cover...
foobar authored
18 dir=lcov_data/`dirname $$x`; \
19 test -d "$$dir" || $(mkinstalldirs) "$$dir"; \
b01f5b3 Fixed gcov for generated files
Ilia Alshanetsky authored
20 if test -f "$(top_srcdir)/$$y.c"; then \
21 ln -f -s $(top_srcdir)/$$y.c lcov_data/$$y.c; \
30dc899 MFH: - Added --enable-gcov configure option to enable C-level code cover...
foobar authored
22 fi; \
50cc487 @rlerdorf MFH: Patch from Nuno
rlerdorf authored
23 if test -f "$(top_srcdir)/$$y.h"; then \
24 ln -f -s $(top_srcdir)/$$y.h lcov_data/$$y.h; \
25 fi; \
b01f5b3 Fixed gcov for generated files
Ilia Alshanetsky authored
26 if test -f "$(top_srcdir)/$$y.re"; then \
27 ln -f -s $(top_srcdir)/$$y.re lcov_data/$$y.re; \
30dc899 MFH: - Added --enable-gcov configure option to enable C-level code cover...
foobar authored
28 fi; \
b01f5b3 Fixed gcov for generated files
Ilia Alshanetsky authored
29 if test -f "$(top_srcdir)/$$y.y"; then \
30 ln -f -s $(top_srcdir)/$$y.y lcov_data/$$y.y; \
de8052a MFH
foobar authored
31 fi; \
b01f5b3 Fixed gcov for generated files
Ilia Alshanetsky authored
32 if test -f "$(top_srcdir)/$$y.l"; then \
33 ln -f -s $(top_srcdir)/$$y.l lcov_data/$$y.l; \
de8052a MFH
foobar authored
34 fi; \
618e623 fix lcov processing with gcc 4.1 (some .h files were not copied)
Nuno Lopes authored
35 if test -f "$(top_srcdir)/$$y"; then \
36 ln -f -s $(top_srcdir)/$$y lcov_data/$$y; \
37 fi; \
b01f5b3 Fixed gcov for generated files
Ilia Alshanetsky authored
38 if test -f "$(top_builddir)/$$y.c"; then \
39 ln -f -s $(top_builddir)/$$y.c lcov_data/$$y.c; \
30dc899 MFH: - Added --enable-gcov configure option to enable C-level code cover...
foobar authored
40 fi; \
6abf54a Avoid gcov conflicts on non-unique filenames
Ilia Alshanetsky authored
41 test -f "$$x.gcno" && cp $$x.gcno lcov_data/$$y.gcno ; \
42 test -f "$$x.gcda" && cp $$x.gcda lcov_data/$$y.gcda ; \
43 test -f "$$x.da" && cp $$x.da lcov_data/$$y.da ; \
44 test -f "$$x.bb" && cp $$x.bb lcov_data/$$y.bb ; \
45 test -f "$$x.bbg" && cp $$x.bbg lcov_data/$$y.bbg ; \
30dc899 MFH: - Added --enable-gcov configure option to enable C-level code cover...
foobar authored
46 done
47 @echo
48 @echo "Generating $@"
25670c5 Final fix for gcov generation.
Ilia Alshanetsky authored
49 @$(LTP) --directory lcov_data/ --capture --base-directory=lcov_data --output-file $@
30dc899 MFH: - Added --enable-gcov configure option to enable C-level code cover...
foobar authored
50
51 lcov-html: php_lcov.info
52 @echo "Generating lcov HTML"
17ff2f4 remove --show-details from lcov's genhtml, as currently we don't separat...
Nuno Lopes authored
53 @$(LTP_GENHTML) --legend --output-directory lcov_html/ --title "PHP Code Coverage" php_lcov.info
30dc899 MFH: - Added --enable-gcov configure option to enable C-level code cover...
foobar authored
54
55 lcov-clean:
56 rm -f php_lcov.info
57 rm -rf lcov_data/
58 rm -rf lcov_html/
59
64ab802 @patrickallaert - Fixed bug #52019 (make lcov doesn't support TESTS variable anymore)
patrickallaert authored
60 lcov-clean-data:
61 @find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f
Something went wrong with that request. Please try again.