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

CI fix: pre-exclude source files when analyzing coverage #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tpwrules
Copy link

lcov 2.x, unlike lcov 1.x, gives errors like geninfo: ERROR: mismatched end line for _ZN12CRC_CRC_Test8TestBodyEv at /home/runner/work/libcanard/libcanard/tests/test_crc.cpp:42: 42 -> 55 for source files which contain gtest tests.

These files are removed from the coverage information in a later step, but lcov now fails to create the initial coverage info because of them.

Fix this problem (and thus CI) by excluding the files from the initial coverage info instead of removing them later. Note that the exclude order is relevant to ensure all excludes trigger, avoiding errors that some are unused. Verified that identical coverage stats are generated for 2.x as compared to 1.x.

lcov 2.x, unlike lcov 1.x, gives errors like `geninfo: ERROR: mismatched
end line for _ZN12CRC_CRC_Test8TestBodyEv at
/home/runner/work/libcanard/libcanard/tests/test_crc.cpp:42: 42 -> 55`
for source files which contain gtest tests.

These files are removed from the coverage information in a later step,
but lcov now fails to create the initial coverage info because of them.

Fix this problem (and thus CI) by excluding the files from the initial
coverage info instead of removing them later. Note that the exclude
order is relevant to ensure all excludes trigger, avoiding errors that
some are unused. Verified that identical coverage stats are generated
for 2.x as compared to 1.x.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant