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
Fix parsing of gcov metadata #601
Fix parsing of gcov metadata #601
Conversation
gcc-11 has metadata line "-: 0:Source is newer than graph" which throws an error. Add the directory of the gcov file to the heuristic to fix test shared_lib for gcc-11.
455e3b4
to
f1d1b15
Compare
Codecov Report
@@ Coverage Diff @@
## master #601 +/- ##
==========================================
- Coverage 95.19% 95.14% -0.06%
==========================================
Files 23 23
Lines 3350 3355 +5
Branches 614 616 +2
==========================================
+ Hits 3189 3192 +3
- Misses 89 90 +1
- Partials 72 73 +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.
simple and elegant :)
Using a None value does kind of violate the type annotations around that code, but for now this won't break anything and that can be fixed in the next refactoring push.
(If you want to fix this, note that now the metadata values are not str
but Optional[str]
. This also means the metadata["Source"]
access in process_gcov_data() could be None, as far as the type system is concerned. The most elegant approach to solve this would be to move the “Source must exist” check from the metadata-parser into process-gcov-data, to something like source = metadata.get("Source"); if source is None: raise RuntimeError(...)
)
@latk I've moved the |
Always strip metadata value.
0e47ad3
to
ad0a8fb
Compare
I don't entirely understand. Could you show an example of what you want to do? |
I wan't to add leading whitespaces to the following doctest:
The whitepaces shouldn't be removed by the editor on save. One solution is to write a single line string with |
Gcc-11 has metadata lines without values in the gcov file (see #596). This PR add support for this lines and uses as value
None
.Closes #596.