Question

I measure coverage for my code using gcov library and I would like to generate coverage report in user-friendly format. I've found lcov utility for that, but it's not compatibile with Windows environment (mainly because of the way the paths are parsed). Does anyone know about actively supported lcov port for Windows?

It seems that making it work on Windows would be quite easy (it think it might even be solved by few creative batch/perl scripts that mimic the behavior of unix shell commands), and the tool is quite useful, so I suppose someone might have already done it.

Was it helpful?

Solution

While it may be dirty, lcov seems to work under cygwin. You may also be interested in the question How can I measure CppUnit test coverage (on win32 and Unix)? and its answers. Visual Studio seems provide code coverage reports.

OTHER TIPS

There is an actively supported lcov genhtml port for windows here: https://github.com/RickSBrown/jgenhtml.

It's specifically designed to run cross platform - no problems with backslashes in the paths etc.

There is also a windows version of LCOV https://github.com/valbok/lcov with explanation how to use it. We had some problems to use native or another versions of LCOV. For example from here http://simply-embedded.blogspot.com/2014/07/code-coverage-html-reports-using-lcov.html

Our flow is something like:

  1. Build a project in Windows using ARM QNX GCC compiler, collect gcno files.

  2. Copy binaries and configs to a target under QNX and run them, collect gcda files.

  3. Run LCOV (on Windows or Linux) to create reports.

In case of using native version of LCOV, reports will be broken due to mess up of windows and linux paths and some bugs inside LCOV scripts. We had to fix the scripts a bit to avoid problems like dir duplicates, slashes, broken paths etc.

There is a windows version done by Donald MacQueen under http://www.macqueen.us/lcov.html but I have not tested it. I have made my own version which You can find here:
http://simply-embedded.blogspot.com/2014/07/code-coverage-html-reports-using-lcov.html
This is done on version 1.11 of LCOV.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top