-
Notifications
You must be signed in to change notification settings - Fork 214
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
More flexible way to specify excludes when using 'setup_target_for_coverage_lcov' #54
Comments
@AlessandroGiusa How are you specifying your excludes? If you use absolute paths, they shouldn't be modified by the function. TBH I always use I originally added the code to convert relative paths to absolute in #39, because at the time only absolute paths worked -- any relative paths you specified would simply be ignored, which was a huge problem for a lot of users and a major source of confusion / bug reports. But that was before I discovered that adding With |
@AlessandroGiusa Hmmm. My only issue with this is that, if the IOW, if I have a subdirectory Sure, I could pass Lcov's "patterns-only" exclusion processing just feels kind of limiting, and could lead to erroneous matches if we expect everyone to start using |
Hello,
thank you for providing great cmake modules!
I had the problem when using setup_target_for_coverage_lcov such that the excludes where always based on the base path. I was getting coverage results from v1 c++ libs as well. I modified the function a little, that it could just forward the excludes as is to the lcov tool, since the tool already is capable to handle pattern based excludes.
set(LCOV_EXCLUDES "")
foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_LCOV_EXCLUDES})
list(APPEND LCOV_EXCLUDES "${EXCLUDE}")
endforeach()
list(REMOVE_DUPLICATES LCOV_EXCLUDES)
I just removed the part where the path gets calculated.
For me that way the problem is solved. Maybe you have a better idea how to do it. I wanted to just mention the issue.
Thank you and best regards.
Alessandro
The text was updated successfully, but these errors were encountered: