Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 80 lines (71 sloc) 2.42 kb
30dc899 MFH: - Added --enable-gcov configure option to enable C-level code cover...
foobar authored
1
2 #
3 # LCOV
4 #
5
65948ec @m6w6 LTP/gcov/lcov
m6w6 authored
6 LCOV_INCLUDE="."
7
30dc899 MFH: - Added --enable-gcov configure option to enable C-level code cover...
foobar authored
8 lcov: lcov-html
9
11a5da5 @patrickallaert - Fixed bug #52019 (make lcov doesn't support TESTS variable anymore)
patrickallaert authored
10 lcov-test: lcov-clean-data test
30dc899 MFH: - Added --enable-gcov configure option to enable C-level code cover...
foobar authored
11
12 php_lcov.info: lcov-test
13 @echo "Generating data for $@"
14 @rm -rf lcov_data/
15 @$(mkinstalldirs) lcov_data/
16 @echo
0cb2606 fix race condition in find (it was finding the copied files over and ove...
Nuno Lopes authored
17 -@files=`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' | $(EGREP) $(LCOV_INCLUDE) | uniq` ;\
18 for x in $$files; do \
30dc899 MFH: - Added --enable-gcov configure option to enable C-level code cover...
foobar authored
19 echo -n . ;\
b01f5b3 Fixed gcov for generated files
Ilia Alshanetsky authored
20 y=`echo $$x | sed -e 's!\.libs/!!'`; \
30dc899 MFH: - Added --enable-gcov configure option to enable C-level code cover...
foobar authored
21 dir=lcov_data/`dirname $$x`; \
22 test -d "$$dir" || $(mkinstalldirs) "$$dir"; \
b01f5b3 Fixed gcov for generated files
Ilia Alshanetsky authored
23 if test -f "$(top_srcdir)/$$y.c"; then \
24 ln -f -s $(top_srcdir)/$$y.c lcov_data/$$y.c; \
30dc899 MFH: - Added --enable-gcov configure option to enable C-level code cover...
foobar authored
25 fi; \
50cc487 @rlerdorf MFH: Patch from Nuno
rlerdorf authored
26 if test -f "$(top_srcdir)/$$y.h"; then \
27 ln -f -s $(top_srcdir)/$$y.h lcov_data/$$y.h; \
28 fi; \
b01f5b3 Fixed gcov for generated files
Ilia Alshanetsky authored
29 if test -f "$(top_srcdir)/$$y.re"; then \
30 ln -f -s $(top_srcdir)/$$y.re lcov_data/$$y.re; \
30dc899 MFH: - Added --enable-gcov configure option to enable C-level code cover...
foobar authored
31 fi; \
b01f5b3 Fixed gcov for generated files
Ilia Alshanetsky authored
32 if test -f "$(top_srcdir)/$$y.y"; then \
33 ln -f -s $(top_srcdir)/$$y.y lcov_data/$$y.y; \
de8052a MFH
foobar authored
34 fi; \
b01f5b3 Fixed gcov for generated files
Ilia Alshanetsky authored
35 if test -f "$(top_srcdir)/$$y.l"; then \
36 ln -f -s $(top_srcdir)/$$y.l lcov_data/$$y.l; \
de8052a MFH
foobar authored
37 fi; \
618e623 fix lcov processing with gcc 4.1 (some .h files were not copied)
Nuno Lopes authored
38 if test -f "$(top_srcdir)/$$y"; then \
39 ln -f -s $(top_srcdir)/$$y lcov_data/$$y; \
40 fi; \
b01f5b3 Fixed gcov for generated files
Ilia Alshanetsky authored
41 if test -f "$(top_builddir)/$$y.c"; then \
42 ln -f -s $(top_builddir)/$$y.c lcov_data/$$y.c; \
30dc899 MFH: - Added --enable-gcov configure option to enable C-level code cover...
foobar authored
43 fi; \
65948ec @m6w6 LTP/gcov/lcov
m6w6 authored
44 if test -f "$$x.gcno"; then \
45 cp $$x.gcno lcov_data/$$y.gcno ; \
46 fi; \
47 if test -f "$$x.gcda"; then \
48 cp $$x.gcda lcov_data/$$y.gcda ; \
49 fi; \
50 if test -f "$$x.da"; then \
51 cp $$x.da lcov_data/$$y.da ; \
52 fi; \
53 if test -f "$$x.bb"; then \
54 cp $$x.bb lcov_data/$$y.bb ; \
55 fi; \
56 if test -f "$$x.bbg"; then \
57 cp $$x.bbg lcov_data/$$y.bbg ; \
58 fi; \
59 done; \
eedb2b6 Daniel Convissor wants to test ext/date/lib, so enable code coverage dat...
Nuno Lopes authored
60 for dir in ext/bcmath/libbcmath 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 \
65948ec @m6w6 LTP/gcov/lcov
m6w6 authored
61 if test -d lcov_data/$$dir; then \
62 rm -rf lcov_data/$$dir ; \
63 fi; \
a487c8b - MFH Exclude bundled libs from gcov processing
Marcus Boerger authored
64 done
30dc899 MFH: - Added --enable-gcov configure option to enable C-level code cover...
foobar authored
65 @echo
66 @echo "Generating $@"
25670c5 Final fix for gcov generation.
Ilia Alshanetsky authored
67 @$(LTP) --directory lcov_data/ --capture --base-directory=lcov_data --output-file $@
30dc899 MFH: - Added --enable-gcov configure option to enable C-level code cover...
foobar authored
68
69 lcov-html: php_lcov.info
70 @echo "Generating lcov HTML"
17ff2f4 remove --show-details from lcov's genhtml, as currently we don't separat...
Nuno Lopes authored
71 @$(LTP_GENHTML) --legend --output-directory lcov_html/ --title "PHP Code Coverage" php_lcov.info
30dc899 MFH: - Added --enable-gcov configure option to enable C-level code cover...
foobar authored
72
73 lcov-clean:
74 rm -f php_lcov.info
75 rm -rf lcov_data/
76 rm -rf lcov_html/
77
11a5da5 @patrickallaert - Fixed bug #52019 (make lcov doesn't support TESTS variable anymore)
patrickallaert authored
78 lcov-clean-data:
79 @find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f
Something went wrong with that request. Please try again.