diff options
author | Oliver Steffen <osteffen@redhat.com> | 2024-09-30 20:32:40 +0200 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-12-04 06:08:05 +0000 |
commit | 61c714285f8cb83aa89b91798255f82260fa4ac2 (patch) | |
tree | d480392ef8accb3830c34b7ecb599463ef0439b9 | |
parent | 29859cbc28cc324c92179556dff17d523b6c684e (diff) | |
download | edk2-61c714285f8cb83aa89b91798255f82260fa4ac2.tar.gz |
BaseTools: Coverage: make lcov v2.0 work
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
- https://github.com/linux-test-project/lcov/issues/209
- https://github.com/linux-test-project/lcov/issues/238
Signed-off-by: Oliver Steffen <osteffen@redhat.com>
-rw-r--r-- | BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py b/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py index 31d13b2ee7..9fb8a19c6d 100644 --- a/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py +++ b/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py @@ -156,7 +156,8 @@ class HostBasedUnitTestRunner(IUefiBuildPlugin): 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
|