Comments (3)
One thing you might want to do, is to simply generate a differential report between the two. (There are obviously no source differences - so any differences in numbers are down to the tools.) You probably want to turn off function coverage as that will somewhat pollute the data given that py2lcov will report it but coverage.py wont (so will look like purely additions or deletions, depending on the direction of compare .... entirely predictable, and completely unhelpful).
The differential report will call out all the inconsistencies.
from lcov.
I'm very confused that you keep saying py2lcov will report function coverage data when for me it definitely does not and I don't see how it possibly can given that coverage xml
doesn't either.
Anyway, here's the result of genhtml --baseline-file B.lcov --diff-file /dev/null --ignore-errors empty -o ABdiff --flat --no-function-coverage A.lcov
. There's definitely something weird going on here; just on a quick glance, several of the GIC and GUC lines are the beginnings of docstrings, which should be treated as lines that generated no code.
Adding --branch-coverage to the invocation gives me
Reading tracefile A.lcov.
genhtml: ERROR: (corrupt) unable to read trace file 'A.lcov':
genhtml: ERROR: (inconsistent) "A.lcov":67: unexpected line number '0' in .info file record 'BRDA:0,0,0,1'
which is the aforementioned nedbat/coveragepy#1846 issue.
from lcov.
For the first question: if the tool can find the source file, then it parses the file to find function decls (...making some assumptions about indentation rules). It then generates a function coverage record, claiming that the function is hit as many times as the first line in the function was.
If your version of py2lcov
does not contain that support - which version are you using, and does it look like this one?
Note that the tool assumes that the file it found is the one referred in the input data. Generally true - but maybe not, if there is some delay between test execution and data extraction, and if people are not so careful with revision management.
In a larger environment: this is also why it is a good idea to use the --version-script
feature to tag the coverage data such that subsequent users can do some validity checking. (Long back, we had some very strange validation results that took some time to figure out. Never again.)
For the second: if we have GIC and UIC lines, then 'A.lcov' is claiming that that there are line coverpoints in those locations. From your description: that seems not correct. Not sure why that happens (would need to look at testcase).
For the third: you can tell the tool to --ignore inconsistent
- and then it will skip that record. (There may be subsequent issues that also need to be ignored, and it is possible that you then hit a fatal error that cannot be ignored.
from lcov.
Related Issues (20)
- Duplicate folder structure (--prefix does not help) HOT 2
- gcov error:std::bad_alloc HOT 8
- lcov fails with gcc 14 HOT 1
- perl2lcov: unexpected data type 'time' HOT 6
- genhtml package removed from PyPI HOT 1
- RPM 2.1-1 does not install on Rocky Linux 8 or Centos7 HOT 1
- Unable to generate gcda file for cc_library_shared module HOT 4
- inconsistent branch coverage summary HOT 1
- Build of example fails on Ubuntu 22.04.4 LTS due to Makefile using SHELL of /bin/sh (softlink to /bin/dash) HOT 1
- Build of examples fails if part of path is a softlink HOT 4
- Option geninfo_external from a user-provided lcovrc file gets ignored HOT 4
- Incorrect #line directives cause Perl warnings HOT 1
- lcov fails with "(inconsistent) mismatched end line" for googletest code HOT 1
- lcov --no-external behaves incorrectly with 2 or more -d
- path mismatch between diff-file and baseline/current info/dat file HOT 23
- Problems with differential reporting HOT 4
- Possible root causes of geninfo 'mismatched end line for main at start.c' ? HOT 7
- gitdiff should strip a/ b/ prefixes from --- +++ lines HOT 6
- I see functions as uncovered although they are covered HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lcov.