10 lcov-test: lcov-clean-data test
12 php_lcov.info: lcov-test
13 @echo "Generating data for $@"
15 @$(mkinstalldirs) lcov_data/
17 -@files=`find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.c -o -name \*.h | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | $(EGREP) $(LCOV_INCLUDE) | uniq` ;\
18 for x in $$files; do \
20 y=`echo $$x | sed -e 's!\.libs/!!'`; \
21 dir=lcov_data/`dirname $$x`; \
22 test -d "$$dir" || $(mkinstalldirs) "$$dir"; \
23 if test -f "$(top_srcdir)/$$y.c"; then \
24 ln -f -s $(top_srcdir)/$$y.c lcov_data/$$y.c; \
26 if test -f "$(top_srcdir)/$$y.h"; then \
27 ln -f -s $(top_srcdir)/$$y.h lcov_data/$$y.h; \
29 if test -f "$(top_srcdir)/$$y.re"; then \
30 ln -f -s $(top_srcdir)/$$y.re lcov_data/$$y.re; \
32 if test -f "$(top_srcdir)/$$y.y"; then \
33 ln -f -s $(top_srcdir)/$$y.y lcov_data/$$y.y; \
35 if test -f "$(top_srcdir)/$$y.l"; then \
36 ln -f -s $(top_srcdir)/$$y.l lcov_data/$$y.l; \
38 if test -f "$(top_srcdir)/$$y"; then \
39 ln -f -s $(top_srcdir)/$$y lcov_data/$$y; \
41 if test -f "$(top_builddir)/$$y.c"; then \
42 ln -f -s $(top_builddir)/$$y.c lcov_data/$$y.c; \
44 if test -f "$$x.gcno"; then \
45 cp $$x.gcno lcov_data/$$y.gcno ; \
47 if test -f "$$x.gcda"; then \
48 cp $$x.gcda lcov_data/$$y.gcda ; \
50 if test -f "$$x.da"; then \
51 cp $$x.da lcov_data/$$y.da ; \
53 if test -f "$$x.bb"; then \
54 cp $$x.bb lcov_data/$$y.bb ; \
56 if test -f "$$x.bbg"; then \
57 cp $$x.bbg lcov_data/$$y.bbg ; \
60 for dir in ext/bcmath/libbcmath ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcrelib ext/pdo_sqlite/libsqlite ext/sqlite/libsqlite ext/sqlite3/libsqlite ext/xmlrpc/libxmlrpc ext/zip/lib; do \
61 if test -d lcov_data/$$dir; then \
62 rm -rf lcov_data/$$dir ; \
67 @$(LTP) --directory lcov_data/ --capture --base-directory=lcov_data --output-file $@
69 lcov-html: php_lcov.info
70 @echo "Generating lcov HTML"
71 @$(LTP_GENHTML) --legend --output-directory lcov_html/ --title "PHP Code Coverage" php_lcov.info
79 @find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f