mirror of
https://github.com/php/php-src.git
synced 2024-12-02 06:13:40 +08:00
42 lines
1.1 KiB
Makefile
42 lines
1.1 KiB
Makefile
|
|
#
|
|
# LCOV
|
|
#
|
|
|
|
lcov: php_lcov.info
|
|
|
|
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/
|
|
|