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

Convert .coverage to .lcov file #285

Closed
tapika opened this issue Sep 29, 2019 · 6 comments
Closed

Convert .coverage to .lcov file #285

tapika opened this issue Sep 29, 2019 · 6 comments

Comments

@tapika
Copy link

tapika commented Sep 29, 2019

In Visual Studio code there exists extension called Coverage Gutters:
https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters

That extension is targeted to display code coverage information, based on .lcov file format.
(Target programming languages are: Java, Javascript and so on).

Meanwhile C++ is not supported there, even thus you could use vstest.console.exe from Visual studio to execute the test, and produce .coverage file.

To my best understanding ReportGenerator is already capable of parsing .coverage files, and it has also knowledge of lcov.info, since it's parsing them as well.

How complex would it be to perform conversion from .coverage to lcov.info ?

@danielpalme
Copy link
Owner

Genrerating lcov.info files is pretty easy. The format is very simple.

*.coverage files are currently not supported. You have to convert them to XML first. See:
https://github.com/danielpalme/ReportGenerator/wiki/Visual-Studio-Coverage-Tools

Should I add support for lcov.info as an output format?

danielpalme added a commit that referenced this issue Sep 29, 2019
@danielpalme
Copy link
Owner

I just added support for lcov output format.

You can try the following packages:
https://www.nuget.org/packages/ReportGenerator/4.3.0-rc4
https://www.nuget.org/packages/dotnet-reportgenerator-globaltool/4.3.0-rc4

Please use the following command line parameter:
-reporttypes:lcov

@tapika
Copy link
Author

tapika commented Sep 30, 2019

image

Wow ! It does work. On left side - Visual studio, on right side - Visual Studio code.

Thanks, need to test it bit more.

@tapika
Copy link
Author

tapika commented Sep 30, 2019

Is still works on line by line basis, not by scope - but I think it's limitation of visual studio itself.

@tapika
Copy link
Author

tapika commented Sep 30, 2019

Microsoft has similar requirement:
https://developercommunity.visualstudio.com/idea/365850/support-lcov-file-format-for-code-coverage.html

But not sure when it will be available.

@danielpalme
Copy link
Owner

I'm closing this issue. Feel free to reopen if you need further changes.

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

No branches or pull requests

2 participants