Skip to content

Support providing files and lines to include into report via json file #1310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

petrochenkov
Copy link

The inclusion set may be determined by some external script, inspecting e.g. git history.

So, here we give some simple json format for such scripts to produce and for grcov to consume.

@marco-c
Copy link
Collaborator

marco-c commented May 15, 2025

@petrochenkov could you explain your use case?

@petrochenkov
Copy link
Author

petrochenkov commented May 16, 2025

The inclusion set may be determined by some external script, inspecting e.g. git history.

^^^ This is the use case.
We need to collect coverage on a git diff, that is then post-processed by a script.
The post-processing is necessary because it mirrors a build system behavior. The build takes the original source code, then moves it around a bit changing some paths, then builds the changed source, so coverage contains the changed paths, not paths from the original source and diff. We do not control the build and cannot change it.

I initially wanted to support just collecting coverage from a diff (patch file format), but given that it's not enough, I implemented a more general approach that just eats an explicit dump of source ranges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants