diff options
author | foobar <sniper@php.net> | 2005-11-08 16:43:09 +0000 |
---|---|---|
committer | foobar <sniper@php.net> | 2005-11-08 16:43:09 +0000 |
commit | ee7f3b47d491918dc3362bd2dd904d5d79d18df1 (patch) | |
tree | e7d846a39fd129393678a674a2dcc6d23f7ff60a | |
parent | a2bd7505817c9ddfc1826990db2e976a8b2d8037 (diff) | |
download | php-git-ee7f3b47d491918dc3362bd2dd904d5d79d18df1.tar.gz |
- Fixed --enable-gcov to work with VPATH builds too
-rw-r--r-- | Makefile.gcov | 51 | ||||
-rw-r--r-- | NEWS | 3 |
2 files changed, 39 insertions, 15 deletions
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 @@ -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. |