From: foobar Date: Tue, 8 Nov 2005 16:43:09 +0000 (+0000) Subject: - Fixed --enable-gcov to work with VPATH builds too X-Git-Tag: RELEASE_2_0_1~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ee7f3b47d491918dc3362bd2dd904d5d79d18df1;p=php - Fixed --enable-gcov to work with VPATH builds too --- diff --git a/Makefile.gcov b/Makefile.gcov index 80ce36da3f..6400495655 100644 --- a/Makefile.gcov +++ b/Makefile.gcov @@ -1,18 +1,41 @@ -.php_cov_info.ltpdata: - @mkdir -p .cov/; \ - find . -name \*.gcda -o -name \*.gcno | sed -e 's/^\.\/\.cov\/.*//' | xargs --replace cp {} .cov/; \ - find . -name \*.gcda -o -name \*.gcno | sed -e 's/^\.\/\.cov\/.*//' | sed -e 's/^\.\///' | xargs --max-args=1 dirname | sed -e 's/\/.*//' | xargs --replace ln -s `pwd`/{} `pwd`/.cov > /dev/null 2>&1; \ - $(LTP) --directory .cov --output-file=.php_cov_info.ltpdata --capture; \ +# +# LCOV +# -cov: .php_cov_info.ltpdata +lcov: php_lcov.info -cov-html: cov - @$(LTP_GENHTML) -o cov_html/ .php_cov_info.ltpdata -t "PHP Code Coverage" -s; +php_lcov.info: + @echo "Generating data for $@" + @rm -rf lcov_data/ + @$(mkinstalldirs) lcov_data/ + @echo + -@find . -name \*.gcda -o -name \*.gcno | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' | uniq | while read x; do \ + echo -n . ;\ + dir=lcov_data/`dirname $$x`; \ + test -d "$$dir" || $(mkinstalldirs) "$$dir"; \ + if test -f "$(top_srcdir)/$$x.c"; then \ + ln -f -s $(top_srcdir)/$$x.c lcov_data/$$x.c; \ + fi; \ + if test -f "$(top_srcdir)/$$x.re"; then \ + ln -f -s $(top_srcdir)/$$x.re lcov_data/$$x.re; \ + fi; \ + if test -f "$(top_builddir)/$$x.c"; then \ + ln -f -s $(top_builddir)/$$x.c lcov_data/$$x.c; \ + fi; \ + test -f "$$x.gcno" && cp $$x.gcno lcov_data/ ; \ + test -f "$$x.gcda" && cp $$x.gcda lcov_data/ ; \ + done + @echo + @echo "Generating $@" + @$(LTP) --directory lcov_data/ --capture --output-file $@ --test-name PHP_LCOV + +lcov-html: php_lcov.info + @echo "Generating lcov HTML" + @$(LTP_GENHTML) --no-prefix --output-directory lcov_html/ --title "PHP Code Coverage" --show-details php_lcov.info + +lcov-clean: + rm -f php_lcov.info + rm -rf lcov_data/ + rm -rf lcov_html/ -cov-clean: - find . -name \*.gcda -o -name \*.gcno -exec rm -f {} \; - rm -f .cov/* # This is done first, since we are symlinked inside.. - rm -Rf .cov # Now remove the directory - rm -f .php_cov_info.ltpdata - rm -Rf cov_html diff --git a/NEWS b/NEWS index d207eeae88..3520812f29 100644 --- a/NEWS +++ b/NEWS @@ -8,7 +8,8 @@ PHP NEWS (Marcus, Dmitry) - Changed "instanceof" and "catch" operators, is_a() and is_subclass_of() functions to not call __autoload(). (Dmitry) -- Added configure option to enable C-level Code Coverage Instrumenting. (John) +- Added --enable-gcov configure option to enable C-level code coverage. + (John, Jani) - Added to cURL extension: (Ilia) . curl_setopt_array() which allows setting of multiple cURL options. . CURLINFO_HEADER_OUT constant to facilitate request retrieval.