2005-11-30 07:20:01 +08:00
#
# LCOV
#
lcov : lcov -html
lcov-test : all
@echo "Running test suite"
2005-12-01 06:47:03 +08:00
@find . -name \* .gcda -o -name \* .da -o -name \* .bbg? | xargs rm -f
2005-11-30 07:20:01 +08:00
-@if test ! -z " $( PHP_EXECUTABLE) " && test -x " $( PHP_EXECUTABLE) " ; then \
NO_INTERACTION = 1 \
TEST_PHP_EXECUTABLE = $( PHP_EXECUTABLE) \
TEST_PHP_SRCDIR = $( top_srcdir) \
CC = " $( CC) " \
$( PHP_EXECUTABLE) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $( top_srcdir) /run-tests.php -d 'extension_dir=modules/' -d ` ( . $( PHP_MODULES) ; echo extension = $$ dlname) ` tests/; \
elif test ! -z " $( SAPI_CLI_PATH) " && test -x " $( SAPI_CLI_PATH) " ; then \
NO_INTERACTION = 1 \
TEST_PHP_EXECUTABLE = $( top_builddir) /$( SAPI_CLI_PATH) \
TEST_PHP_SRCDIR = $( top_srcdir) \
CC = " $( CC) " \
$( top_builddir) /$( SAPI_CLI_PATH) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $( top_srcdir) /run-tests.php $( TESTS) ; \
else \
echo "ERROR: Cannot run tests without CLI sapi." ; \
fi
php_lcov.info : lcov -test
@echo " Generating data for $@ "
@rm -rf lcov_data/
@$( mkinstalldirs) lcov_data/
@echo
2006-09-10 20:37:44 +08:00
-@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 \
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 ; \
2005-12-05 12:22:16 +08:00
test -f " $$ x.gcno " && cp $$ x.gcno lcov_data/$$ y.gcno ; \
test -f " $$ x.gcda " && cp $$ x.gcda lcov_data/$$ y.gcda ; \
test -f " $$ x.da " && cp $$ x.da lcov_data/$$ y.da ; \
test -f " $$ x.bb " && cp $$ x.bb lcov_data/$$ y.bb ; \
test -f " $$ x.bbg " && cp $$ x.bbg lcov_data/$$ y.bbg ; \
2005-11-30 07:20:01 +08:00
done
2008-08-04 02:57:25 +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/sqlite/libsqlite ext/sqlite3/libsqlite ext/xmlrpc/libxmlrpc ext/zip/lib; do \
2008-07-29 16:10:44 +08:00
test -d lcov_data/$$ dir && rm -rf lcov_data/$$ dir ; \
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/