|
2 | 2 | # LCOV
|
3 | 3 | #
|
4 | 4 |
|
5 |
| -LCOV_INCLUDE="." |
6 |
| - |
7 | 5 | lcov: lcov-html
|
8 | 6 |
|
9 | 7 | lcov-test: lcov-clean-data test
|
10 | 8 |
|
11 | 9 | php_lcov.info: lcov-test
|
12 |
| - @echo "Generating data for $@" |
13 |
| - @rm -rf lcov_data/ |
14 |
| - @$(mkinstalldirs) lcov_data/ |
15 |
| - @echo |
16 |
| - -@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` ;\ |
17 |
| - for x in $$files; do \ |
18 |
| - echo -n . ;\ |
19 |
| - y=`echo $$x | sed -e 's!\.libs/!!'`; \ |
20 |
| - dir=lcov_data/`dirname $$x`; \ |
21 |
| - test -d "$$dir" || $(mkinstalldirs) "$$dir"; \ |
22 |
| - if test -f "$(top_srcdir)/$$y.c"; then \ |
23 |
| - ln -f -s $(top_srcdir)/$$y.c lcov_data/$$y.c; \ |
24 |
| - fi; \ |
25 |
| - if test -f "$(top_srcdir)/$$y.h"; then \ |
26 |
| - ln -f -s $(top_srcdir)/$$y.h lcov_data/$$y.h; \ |
27 |
| - fi; \ |
28 |
| - if test -f "$(top_srcdir)/$$y.re"; then \ |
29 |
| - ln -f -s $(top_srcdir)/$$y.re lcov_data/$$y.re; \ |
30 |
| - fi; \ |
31 |
| - if test -f "$(top_srcdir)/$$y.y"; then \ |
32 |
| - ln -f -s $(top_srcdir)/$$y.y lcov_data/$$y.y; \ |
33 |
| - fi; \ |
34 |
| - if test -f "$(top_srcdir)/$$y.l"; then \ |
35 |
| - ln -f -s $(top_srcdir)/$$y.l lcov_data/$$y.l; \ |
36 |
| - fi; \ |
37 |
| - if test -f "$(top_srcdir)/$$y"; then \ |
38 |
| - ln -f -s $(top_srcdir)/$$y lcov_data/$$y; \ |
39 |
| - fi; \ |
40 |
| - if test -f "$(top_builddir)/$$y.c"; then \ |
41 |
| - ln -f -s $(top_builddir)/$$y.c lcov_data/$$y.c; \ |
42 |
| - fi; \ |
43 |
| - if test -f "$$x.gcno"; then \ |
44 |
| - cp $$x.gcno lcov_data/$$y.gcno ; \ |
45 |
| - fi; \ |
46 |
| - if test -f "$$x.gcda"; then \ |
47 |
| - cp $$x.gcda lcov_data/$$y.gcda ; \ |
48 |
| - fi; \ |
49 |
| - if test -f "$$x.da"; then \ |
50 |
| - cp $$x.da lcov_data/$$y.da ; \ |
51 |
| - fi; \ |
52 |
| - if test -f "$$x.bb"; then \ |
53 |
| - cp $$x.bb lcov_data/$$y.bb ; \ |
54 |
| - fi; \ |
55 |
| - if test -f "$$x.bbg"; then \ |
56 |
| - cp $$x.bbg lcov_data/$$y.bbg ; \ |
57 |
| - fi; \ |
58 |
| - done; \ |
59 |
| - for dir in ext/date/lib ext/fileinfo/libmagic ext/gd/libgd ext/pcre/pcre2lib; do \ |
60 |
| - if test -d lcov_data/$$dir; then \ |
61 |
| - rm -rf lcov_data/$$dir ; \ |
62 |
| - fi; \ |
63 |
| - done |
64 |
| - @echo |
65 |
| - @echo "Generating $@" |
66 |
| - @$(LTP) --directory lcov_data/ --capture --base-directory=lcov_data --output-file $@ |
| 10 | + @echo "Generating lcov data for $@" |
| 11 | + @$(LTP) --capture --no-external --directory . --output-file $@ |
| 12 | + @echo "Stripping bundled libraries from $@" |
| 13 | + @$(LTP) --remove $@ \ |
| 14 | + '*/<stdout>' \ |
| 15 | + '$(top_srcdir)/ext/bcmath/libbcmath/*' \ |
| 16 | + '$(top_srcdir)/ext/date/lib/*' \ |
| 17 | + '$(top_srcdir)/ext/fileinfo/libmagic/*' \ |
| 18 | + '$(top_srcdir)/ext/gd/libgd/*' \ |
| 19 | + '$(top_srcdir)/ext/hash/sha3/*' \ |
| 20 | + '$(top_srcdir)/ext/mbstring/libmbfl/*' \ |
| 21 | + '$(top_srcdir)/ext/opcache/jit/libudis86/*' \ |
| 22 | + '$(top_srcdir)/ext/pcre/pcre2lib/*' \ |
| 23 | + '$(top_srcdir)/ext/xmlrpc/libxmlrpc/*' \ |
| 24 | + --output-file $@ |
67 | 25 |
|
68 | 26 | lcov-html: php_lcov.info
|
69 | 27 | @echo "Generating lcov HTML"
|
70 | 28 | @$(LTP_GENHTML) --legend --output-directory lcov_html/ --title "PHP Code Coverage" php_lcov.info
|
71 | 29 |
|
72 | 30 | lcov-clean:
|
73 | 31 | rm -f php_lcov.info
|
74 |
| - rm -rf lcov_data/ |
75 | 32 | rm -rf lcov_html/
|
76 | 33 |
|
77 | 34 | lcov-clean-data:
|
|
0 commit comments