-
Notifications
You must be signed in to change notification settings - Fork 283
Don't use temporary directory for running gcov #525
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #525 +/- ##
==========================================
- Coverage 96.17% 95.66% -0.51%
==========================================
Files 21 21
Lines 2846 2835 -11
Branches 487 485 -2
==========================================
- Hits 2737 2712 -25
- Misses 48 61 +13
- Partials 61 62 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
17bda2b
to
8b08929
Compare
8b08929
to
d270daf
Compare
The updated test data in this PR shows a decrease in covered lines. More precisely, more lines are now detected as “noncode”, thus increasing the coverage percentage. This is quite unexpected, as the change in this PR should not have affected the coverage data. Do you have any idea theory as to what is happening here? |
This is a result of extending the regular expression for the "File not found error". The verbose log is:
And the result is:
Without the change of the regular expression the output from a call in a different working directory is used:
with the result:
In the old version the function Line 1025 in 044b5c9
Now it returns True --> Line isn't counted. I suggest to change the function to: code = _CPP_STYLE_COMMENT_PATTERN.sub("", code)
code = _C_STYLE_COMMENT_PATTERN.sub("", code)
code = code.strip().replace(" ", "").replace("{", "").replace("}", "")
return len(code) == 0 or code == "else" |
@latk I'm working on the adaption of
is working but if the spaces are removed (
I think removing the whilespaces as suggested is correct, what do you think? |
As discussed in #524 on MacOs there is a problem with the temporary directory. The files generated by gcov are prefixed with the name of the data file (Option
--long-path-names
) to be able to rungcov
in parallel.The regular expression to catch the "Source not found" error is extended to match the message for a clang based gcov command.
The test of the example is extended to test all available output formats except the detailed html.
Maybe we should also extend the check of the gcovr output to also try the next working directory if there is no coverage data in the gcov file instead of only rely on the "Source not found" message.
Closes #524