2005-11-30 07:20:01 +08:00
#
# LCOV
#
2012-01-23 17:48:18 +08:00
LCOV_INCLUDE = "."
2005-11-30 07:20:01 +08:00
lcov : lcov -html
2010-06-11 22:04:57 +08:00
lcov-test : lcov -clean -data test
2005-11-30 07:20:01 +08:00
php_lcov.info : lcov -test
@echo " Generating data for $@ "
@rm -rf lcov_data/
@$( mkinstalldirs) lcov_data/
@echo
2014-06-04 05:21:20 +08:00
-@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) | sed -e 's/.libs/zzzz/g' | sort | sed -e 's/zzzz/.libs/g' | uniq` ; \
2012-02-21 00:01:34 +08:00
for x in $$ files; do \
2005-11-30 07:20:01 +08:00
echo -n . ; \
2005-12-05 01:27:34 +08:00
y = ` echo $$ x | sed -e 's!\.libs/!!' ` ; \
2005-11-30 07:20:01 +08:00
dir = lcov_data/` dirname $$ x` ; \
test -d " $$ dir " || $( mkinstalldirs) " $$ dir " ; \
2005-12-05 01:27:34 +08:00
if test -f " $( top_srcdir) / $$ y.c " ; then \
ln -f -s $( top_srcdir) /$$ y.c lcov_data/$$ y.c; \
2005-11-30 07:20:01 +08:00
fi ; \
2006-06-10 07:47:10 +08:00
if test -f " $( top_srcdir) / $$ y.h " ; then \
ln -f -s $( top_srcdir) /$$ y.h lcov_data/$$ y.h; \
fi ; \
2005-12-05 01:27:34 +08:00
if test -f " $( top_srcdir) / $$ y.re " ; then \
ln -f -s $( top_srcdir) /$$ y.re lcov_data/$$ y.re; \
2005-11-30 07:20:01 +08:00
fi ; \
2005-12-05 01:27:34 +08:00
if test -f " $( top_srcdir) / $$ y.y " ; then \
ln -f -s $( top_srcdir) /$$ y.y lcov_data/$$ y.y; \
2005-12-01 06:47:03 +08:00
fi ; \
2005-12-05 01:27:34 +08:00
if test -f " $( top_srcdir) / $$ y.l " ; then \
ln -f -s $( top_srcdir) /$$ y.l lcov_data/$$ y.l; \
2005-12-01 06:47:03 +08:00
fi ; \
2006-09-10 20:37:44 +08:00
if test -f " $( top_srcdir) / $$ y " ; then \
ln -f -s $( top_srcdir) /$$ y lcov_data/$$ y; \
fi ; \
2005-12-05 01:27:34 +08:00
if test -f " $( top_builddir) / $$ y.c " ; then \
ln -f -s $( top_builddir) /$$ y.c lcov_data/$$ y.c; \
2005-11-30 07:20:01 +08:00
fi ; \
2012-01-23 17:48:18 +08:00
if test -f " $$ x.gcno " ; then \
cp $$ x.gcno lcov_data/$$ y.gcno ; \
fi ; \
if test -f " $$ x.gcda " ; then \
cp $$ x.gcda lcov_data/$$ y.gcda ; \
fi ; \
if test -f " $$ x.da " ; then \
cp $$ x.da lcov_data/$$ y.da ; \
fi ; \
if test -f " $$ x.bb " ; then \
cp $$ x.bb lcov_data/$$ y.bb ; \
fi ; \
if test -f " $$ x.bbg " ; then \
cp $$ x.bbg lcov_data/$$ y.bbg ; \
fi ; \
done ; \
2015-10-25 05:36:23 +08:00
for dir in ext/bcmath/libbcmath ext/date/lib ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcrelib ext/pdo_sqlite/libsqlite ext/sqlite3/libsqlite ext/xmlrpc/libxmlrpc ext/zip/lib; do \
2012-01-23 17:48:18 +08:00
if test -d lcov_data/$$ dir; then \
rm -rf lcov_data/$$ dir ; \
fi ; \
2008-07-29 16:10:44 +08:00
done
2005-11-30 07:20:01 +08:00
@echo
@echo " Generating $@ "
2005-12-09 00:00:28 +08:00
@$( LTP) --directory lcov_data/ --capture --base-directory= lcov_data --output-file $@
2005-11-30 07:20:01 +08:00
lcov-html : php_lcov .info
@echo "Generating lcov HTML"
2007-01-04 22:11:47 +08:00
@$( LTP_GENHTML) --legend --output-directory lcov_html/ --title "PHP Code Coverage" php_lcov.info
2005-11-30 07:20:01 +08:00
lcov-clean :
rm -f php_lcov.info
rm -rf lcov_data/
rm -rf lcov_html/
2010-06-11 22:04:57 +08:00
lcov-clean-data :
@find . -name \* .gcda -o -name \* .da -o -name \* .bbg? | xargs rm -f