AdamNiederer / cov

An emacs extension for displaying coverage data on your code
GNU General Public License v3.0
76 stars 16 forks source link

lcov parsing #32

Closed xenodium closed 2 years ago

xenodium commented 3 years ago

First of, this package looks wonderful. Thanks for building it.

Apologies if I missed something here, but was unable to set this up using an lcov file.

I looked at the included parsers and tried explicitly parsing with

(cov--read-and-parse "coverage.lcov" 'gcov)
(cov--read-and-parse "coverage.lcov" 'clover)
(cov--read-and-parse "coverage.lcov" 'coveralls)
(cov--read-and-parse "coverage.lcov" 'coveragepy)

gcov files had no issues parsing with (cov--read-and-parse "coverage.gcov" 'gcov).

The coverage.lcov file had the following content:

SF:/private/tmp/Foo/Sources/Foo/Foo.swift
FN:4,$s3FooAAV5greet15defaultGreetingySb_tF
FNDA:1,$s3FooAAV5greet15defaultGreetingySb_tF
FNF:1
FNH:1
DA:4,1
DA:5,1
DA:6,1
DA:7,1
DA:8,0
DA:9,1
DA:10,1
LF:7
LH:6
end_of_record

Currently, it supports gcov, lcov, and clover output, as well as the Coveralls format produced by undercover.el.

README mentioned lcov support, so I'm wondering if conversion is needed? Should I have tried something else?

Thank you.

dhanak commented 3 years ago

I was wondering the same... Help would be appreciated.

Aaronzinhoo commented 3 years ago

@xenodium @dhanak , going through the source code it seems to only support gcov. I think there should be a combination of this package and coverlay as they almost seem to complete each other. I may be interested in doing the merge but both packages do not seem too active.

snogge commented 3 years ago

cov.el does not support the .info files that lcov uses. They are actually a gcov intermediate format that should be supported. I was planning to add that but got stuck with #23 - which I have still not fixed.
Adding a parser for .info should not be complicated. Patches are welcome. @AdamNiederer is not active in the issues but in my experience he does review and merge PRs quickly.

Edit: I had the file formats mixed up, lcov uses it's own internal trace format described in geninfo (1). I was thinking of the gcov format used when gcov is given the --intermediate-format flag. The latter format is actually supported.

snogge commented 3 years ago

I've implemented a lcov parser, but I'm still working in the lookup functions. Any ideas on how you should go from a source file to a lcov info file would be appreciated.