-
Notifications
You must be signed in to change notification settings - Fork 283
Percentage values in json-summary report #517
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 occ 8000 asionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
First analysis:
|
Yes, the summary report is inconsistent. I'm not entirely convinced whether [0,100] or [0,1] would be appropriate ranges in this context, but since it's a percentage I would expect the [0,100] range as well. Since the JSON formats are versioned, this can technically be changed without breaking backwards compatibility. I have a branch somewhere that makes the coverage calculation clearer and would completely prevent such issues from reoccurring in the future. Then, fixing this issue would be a 1-line change. I'll open a PR once #515 is merged. |
I've in mind that there was a discussion if 0.0 to 100 or 0.0 or 1.0 is correct. After searching I found this: |
Describe the bug
In the json-summary report, the file-summary uses ratios in the attributes 'line_percent' and 'branch_percent'.
The value for full coverage is 1.0
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The value for full coverage should be 100.0 (i.e. a percentage value)
Example output
{ "branch_covered": 2, "branch_percent": 100.0, "branch_total": 2, "files": [ { "branch_covered": 2, "branch_percent": 1.0, "branch_total": 2, "filename": "impl/my_library/src/my_base_class.cpp", "line_covered": 6, "line_percent": 1.0, "line_total": 6 } ], "gcovr/summary_format_version": "0.2", "line_covered": 6, "line_percent": 100.0, "line_total": 6, "root": "../../../../test" }
The text was updated successfully, but these errors were encountered: