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

lcov-diff produces too much data #4

Open
Desperado17 opened this issue Jan 20, 2023 · 2 comments
Open

lcov-diff produces too much data #4

Desperado17 opened this issue Jan 20, 2023 · 2 comments

Comments

@Desperado17
Copy link

Trying to make this run with an example:

/home/user/.cargo/lcov-diff test2.txt test1.txt -o textDiff.txt

The resulting textDiff.txt contains all the lines from test2 and some more instead of a true diff.

test1.txt
test2.txt

@capgelka
Copy link
Owner

capgelka commented Jan 20, 2023

I can't say I am an expert in lcov file format, but these are kind of strange files, I mean there are lines with zero coverage. So there is no coverage in both of your inputs.

The tool doesn't remove the lines with 0 hits, just left them as is. So if you try to diff2 from diff1 as in your example all 4 DA records will be in the result. That's the first reason for the increased size.
The second is the LF and LH records, which were missed in your inputs and the tool added them.

If you generate HTML reports with genhtml the result will be correct.

Maybe it's a good idea to remove DA:x:0 lines, but the original reports usually contain them. I believe this is to distinguish the lines which can be possibly covered from lines without any code (blank lines, comments, etc.)

So you probably should just look at genhtml results and don't worry about the actual file sizes.

@exp0nge
Copy link

exp0nge commented Oct 10, 2024

Is it possible to add support for the diff file to drop no-op changes as that allows us to get text based summaries versus HTML?

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

No branches or pull requests

3 participants