Skip to content

Commit

Permalink
BaseTools: Coverage: make lcov v2.0 work
Browse files Browse the repository at this point in the history
lcov 2.0 and newer does additional error and consistency checking
compared to previous versions. This can lead to CI jobs failing due to
new/unexpected errors showing up.

See:
- https://edk2.groups.io/g/devel/message/116138
- linux-test-project/lcov#209
- linux-test-project/lcov#238

Signed-off-by: Oliver Steffen <[email protected]>
  • Loading branch information
osteffenrh committed Oct 1, 2024
1 parent c735d3c commit 583e1d8
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ def gen_code_coverage_gcc(self, thebuilder):
return 1

# Coverage data for tested files only
ret = RunCmd("lcov", f"--capture --directory {buildOutputBase}/ --output-file {buildOutputBase}/coverage-test.info --rc lcov_branch_coverage=1")
# `--ignore-errors mismatch` needed to make lcov v2.0+/gcov work.
ret = RunCmd("lcov", f"--capture --directory {buildOutputBase}/ --output-file {buildOutputBase}/coverage-test.info --rc lcov_branch_coverage=1 --ignore-errors mismatch")
if ret != 0:
logging.error("UnitTest Coverage: Failed to build coverage data for tested files.")
return 1
Expand Down

0 comments on commit 583e1d8

Please sign in to comment.