-
Notifications
You must be signed in to change notification settings - Fork 238
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
Add Branch Coverage data for ProfData coverage files #477
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! I made some incredibly nitpicky suggestions just to match the existing code style.
I'm by no means a Ruby pro either, so if anyone else has any suggestions feel free to chime in. Otherwise if it's working on your code base and the tests are passing I'm happy to merge this in and cut a release.
Updated the code to use snake case for all the variables, didn't even realize the rest of the codebase was snake 🤦 |
Merged, thanks for the contribution! I'll make a release to include this. |
Happy to help, and excited to get all my projects updated with this! |
Using the lcov json data segments, populate
branch_coverage_data
for profdata coverage filesThis allows the cobertura report to correctly calculate branch coverage
Also added branch coverage to the HTML output by using the segments to determine column ranges that were not hit, so null coalesecing operations, or other single line branches can be determined as missed coverage.
Please let me know if there are any updates required for this PR, it's been quite some time since using ruby, so I'm sure the code can be improved.
I made sure the existing tests pass, and i added some small profdata tests to check that the branch data populates as expected.
I've also tested this locally against a real project and compared output to Xcode, to see how it works on a larger codebase.
Example of a covered line with an uncovered branch:
