Skip to content

Ignore zpp in gcovr#21623

Merged
iluuu1994 merged 1 commit intophp:masterfrom
iluuu1994:gcovr-ignore-zpp
Apr 3, 2026
Merged

Ignore zpp in gcovr#21623
iluuu1994 merged 1 commit intophp:masterfrom
iluuu1994:gcovr-ignore-zpp

Conversation

@iluuu1994
Copy link
Copy Markdown
Member

The ZPP macros materialize into optimized code with many error branches that aren't useful to test for every function. Ignore these lines completely by using the gcovr --exclude-lines-by-pattern flag. For codecov to pick up on this change, we generate the xml file manually and point to it in the codecov action. Also move the ignore paths from codecov.yml to Makefile.gcov.

The ZPP macros materialize into optimized code with many error branches that
aren't useful to test for every function. Ignore these lines completely by using
the gcovr --exclude-lines-by-pattern flag. For codecov to pick up on this
change, we generate the xml file manually and point to it in the codecov action.
Also move the ignore paths from codecov.yml to Makefile.gcov.
@iluuu1994
Copy link
Copy Markdown
Member Author

Finally found a solution for this issue. Increased coverage from 54% to 66%.

https://app.codecov.io/gh/php/php-src/tree/master
https://app.codecov.io/gh/php/php-src/tree/iluuu1994%2Fphp-src%3Agcovr-ignore-zpp

There's likely many other places where macros with branches aren't tested. Converting them to inlined functions should work (where possible).

@iluuu1994 iluuu1994 merged commit 7cfde6e into php:master Apr 3, 2026
16 of 18 checks passed
Comment thread build/Makefile.gcov
'ext/mbstring/libmbfl/.*' \
'ext/pcre/pcre2lib/.*'
'ext/pcre/pcre2lib/.*' \
'ext/uri/uriparser/.*'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the uriparser bundled lib be also excluded from LCOV?

Would you like to be this automatized, ie. exclude all bundled sources, by CI?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lcov is currently broken, and honestly I'm not sure it even makes sense to maintain two tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants