Skip to content

Commit 931c400

Browse files
committed
Move gcovr options to config file
Having these in the make file is very annoying, because it requires rebuilding from scratch and rerunning tests just to see if some flag is effective.
1 parent 90747c2 commit 931c400

File tree

2 files changed

+21
-23
lines changed

2 files changed

+21
-23
lines changed

build/Makefile.gcov

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,6 @@ LCOV_EXCLUDES = \
1616
'$(top_srcdir)/parse_date.re' \
1717
'$(top_srcdir)/parse_iso_intervals.re'
1818

19-
GCOVR_EXCLUDES = \
20-
'ext/bcmath/libbcmath/.*' \
21-
'ext/date/lib/.*' \
22-
'ext/fileinfo/libmagic/.*' \
23-
'ext/gd/libgd/.*' \
24-
'ext/hash/sha3/.*' \
25-
'ext/lexbor/lexbor/.*' \
26-
'ext/mbstring/libmbfl/.*' \
27-
'ext/opcache/jit/ir/.*' \
28-
'ext/pcre/pcre2lib/.*' \
29-
'ext/uri/uriparser/.*'
30-
31-
# These patterns have implicit ^/$ anchors.
32-
GCOVR_EXCLUDE_LINES_BY_PATTERNS = \
33-
'.*\b(ZEND_PARSE_PARAMETERS_(START|END|NONE)|Z_PARAM_).*' \
34-
'\s*(default:\s*)?ZEND_UNREACHABLE\(\);\s*'
35-
3619
lcov: lcov-html
3720

3821
php_lcov.info:
@@ -56,15 +39,11 @@ gcovr-html:
5639
@echo "Generating gcovr HTML"
5740
@rm -rf gcovr_html/
5841
@mkdir gcovr_html
59-
gcovr -sr . -o gcovr_html/index.html --html --html-details --exclude-unreachable-branches --exclude-throw-branches \
60-
$(foreach pattern, $(GCOVR_EXCLUDE_LINES_BY_PATTERNS), --exclude-lines-by-pattern $(pattern)) \
61-
$(foreach lib, $(GCOVR_EXCLUDES), -e $(lib))
42+
gcovr -r . -o gcovr_html/index.html --html --html-details
6243

6344
gcovr-xml:
6445
@echo "Generating gcovr XML"
6546
@rm -f gcovr.xml
66-
gcovr -sr . -o gcovr.xml --xml --exclude-unreachable-branches --exclude-throw-branches \
67-
$(foreach pattern, $(GCOVR_EXCLUDE_LINES_BY_PATTERNS), --exclude-lines-by-pattern $(pattern)) \
68-
$(foreach lib, $(GCOVR_EXCLUDES), -e $(lib))
47+
gcovr -r . -o gcovr.xml --xml
6948

7049
.PHONY: gcovr-html lcov-html php_lcov.info

gcovr.cfg

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
print-summary = yes
2+
3+
exclude-throw-branches = yes
4+
exclude-unreachable-branches = yes
5+
6+
# These patterns have implicit ^/$ anchors.
7+
exclude = ext/bcmath/libbcmath/.*
8+
exclude = ext/date/lib/.*
9+
exclude = ext/fileinfo/libmagic/.*
10+
exclude = ext/gd/libgd/.*
11+
exclude = ext/hash/sha3/.*
12+
exclude = ext/lexbor/lexbor/.*
13+
exclude = ext/mbstring/libmbfl/.*
14+
exclude = ext/opcache/jit/ir/.*
15+
exclude = ext/pcre/pcre2lib/.*
16+
exclude = ext/uri/uriparser/.*
17+
18+
exclude-lines-by-pattern = .*\b(ZEND_PARSE_PARAMETERS_(START|END|NONE)|Z_PARAM_).*
19+
exclude-lines-by-pattern = \s*(default:\s*)?ZEND_UNREACHABLE\(\);\s*

0 commit comments

Comments
 (0)