Skip to content
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

Fix lcov summary coverage reporting #1583

Merged
merged 1 commit into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions coverage/lcovreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ def get_lcov(self, fr: FileReporter, analysis: Analysis, outfile: IO[str]) -> No
hashed = base64.b64encode(md5(line).digest()).decode().rstrip("=")
outfile.write(f"DA:{missed},0,{hashed}\n")

outfile.write(f"LF:{len(analysis.statements)}\n")
outfile.write(f"LH:{len(analysis.executed)}\n")
outfile.write(f"LF:{analysis.numbers.n_statements}\n")
outfile.write(f"LH:{analysis.numbers.n_executed}\n")
Copy link
Contributor Author

@imoore76 imoore76 Mar 13, 2023

Choose a reason for hiding this comment

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

This is the change that corrects LF and LH coverage numbers. I copied this from the json report code.


# More information dense branch coverage data.
missing_arcs = analysis.missing_branch_arcs()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_lcov.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def test_empty_init_files(self) -> None:
SF:__init__.py
DA:1,1,1B2M2Y8AsgTpgAmY7PhCfg
LF:0
LH:1
LH:0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated test to reflect corrected behavior.

BRF:0
BRH:0
end_of_record
Expand Down