Is there any actively supported lcov port for windows

筅森魡賤 提交于 2019-11-29 21:56:52

问题


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.


回答1:


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.




回答2:


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.




回答3:


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.




回答4:


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.



来源:https://stackoverflow.com/questions/1816981/is-there-any-actively-supported-lcov-port-for-windows

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!