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

Generating the lcov database format from kcov #360

Open
dinkopehar opened this issue Jun 10, 2021 · 6 comments
Open

Generating the lcov database format from kcov #360

dinkopehar opened this issue Jun 10, 2021 · 6 comments
Labels

Comments

@dinkopehar
Copy link

Hello.

While using kcov, I noticed it produces several formats of coverage. Is there a way to produce lcov style coverge report using kcov ?

Thank you.

@SimonKagstrom
Copy link
Owner

Well, it was originally meant to produce just that. I think the color-scheme is slightly different, but otherwise it should be basically the same. There are some things in lcov/gcov which are difficult to support with kcov, since it doesn't do branch coverage.

Or is there some other feature you're looking for? I'll admit I'm not really up-to-date with lcov, haven't been using it for 10 years or so :-)

@dinkopehar
Copy link
Author

I noticed kcov produces "sonarqube" file and cobertura.xml which is compatible with Java Projects and Jenkins coverage.
Lot of other projects rely on lcov format file. For example, coveralls.io only supports upload in lcov format (I understand that kcov can upload manually, but I had some problems with it running from GitHub. )
Also, many coverage tools in other languages create this lcov report, so extensions for VSCode can display coverage inside gutters of editor from that lcov report.

@SimonKagstrom
Copy link
Owner

Yes, that would be a good reason. I understand what you mean now, so it's the database format itself, and not the HTML reports which are needed.

I'll rename this issue to something like that.

As for vscode, I use coverage gutters with kcov. It supports cobertura, so I just make sure to copy the cobertura.xml / cov.xml to the .vscode-directory and then it works out of the box. The file needs to be named cov.xml.

@SimonKagstrom SimonKagstrom changed the title Generating lcov style coverge report using kcov ? Generating the lcov database format from kcov Jun 18, 2021
@dinkopehar
Copy link
Author

As for vscode, I use coverage gutters with kcov. It supports cobertura, so I just make sure to copy the cobertura.xml / cov.xml to the .vscode-directory and then it works out of the box. The file needs to be named cov.xml.

Oh, great. Scratch this one then. I also have gutters displayed in red and green now in VS Code.

@SimonKagstrom
Copy link
Owner

It can be useful anyway, so I'll keep it open. Not sure when I'll get round to it though (hey, real work takes time it seems! :-)).

Off-topic question: For me, coverage gutters displays really slowly, have you managed to workaround that some way? I've seen bug reports in the coverage gutters github project about it, but it seems unconclusive to me.

@dinkopehar
Copy link
Author

It can be useful anyway, so I'll keep it open. Not sure when I'll get round to it though (hey, real work takes time it seems! :-)).

I know. You did amazing job on this one, I don't even know where would I start with this 😸 .

Off-topic question: For me, coverage gutters displays really slowly, have you managed to workaround that some way? I've seen bug reports in the coverage gutters github project about it, but it seems unconclusive to me.

Well, I'm using kcov with crystal language. I use kcov to instrument generated binary. The output is in coverage directory at the root of project I'm working on.
It wasn't slow for me in VSCode using coverage-gutters extension. Everything is displayed in timely manner. I can recommend to:

  • Set Coverage File names to files you are looking for:
    "coverage-gutters.coverageFileNames": [
          "cov.xml",
          "coverage.xml",
      ]
    
  • Coverage Report File Name set to: coverage/index.html
  • And most importantly, set paths that will be ignored by coverage-gutters extensions traversals:
    "coverage-gutters.ignoredPathGlobs": "**/{node_modules,venv,.venv,vendor,lib,bin}/**"
    

Personally for me wasn't slow, I only use option to display coverage, I don't use Coverage Guttes: Watch to have it constantly read if coverage file change. Maybe setting everything to exact path of generated report instead of leaving it as wildcard (**) can speed things up 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants