是否有任何积极支持的 windows lcov 端口

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1816981/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 13:30:39  来源:igfitidea点击:

Is there any actively supported lcov port for windows

windowsgcovlcov

提问by chalup

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?

我使用 gcov 库测量我的代码的覆盖率,我想以用户友好的格式生成覆盖率报告。我为此找到了 lcov 实用程序,但它与 Windows 环境不兼容(主要是因为解析路径的方式)。有谁知道 Windows 主动支持的 lcov 端口?

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.

似乎让它在 Windows 上工作很容易(它认为它甚至可以通过模仿 unix shell 命令行为的一些创造性的批处理/perl 脚本来解决),而且该工具非常有用,所以我想有人可能有已经做到了。

采纳答案by John Paulett

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

虽然它可能很脏,但 lcov似乎在 cygwin 下工作。您可能还对如何测量 CppUnit 测试覆盖率(在 win32 和 Unix 上)的问题感兴趣及其答案。 Visual Studio似乎提供代码覆盖率报告。

回答by jsman

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

这里有一个积极支持的 windows lcov genhtml 端口:https: //github.com/RickSBrown/jgenhtml

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

它专为跨平台运行而设计 - 路径中的反斜杠等没有问题。

回答by valbok

There is also a windows version of LCOV https://github.com/valbok/lcovwith 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

还有一个 Windows 版本的 LCOV https://github.com/valbok/lcov解释了如何使用它。我们在使用本机或其他版本的 LCOV 时遇到了一些问题。例如从这里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.

  1. 在 Windows 中使用 ARM QNX GCC 编译器构建项目,收集 gcno 文件。

  2. 将二进制文件和配置复制到 QNX 下的目标并运行它们,收集 gcda 文件。

  3. 运行 LCOV(在 Windows 或 Linux 上)以创建报告。

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.

如果使用本机版本的 LCOV,由于 windows 和 linux 路径混乱以及 LCOV 脚本中的一些错误,报告将被破坏。我们不得不稍微修复脚本以避免出现目录重复、斜线、路径损坏等问题。

回答by fryborz

There is a windows version done by Donald MacQueen under http://www.macqueen.us/lcov.htmlbut 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.

http://www.macqueen.us/lcov.html下有一个由 Donald MacQueen 完成的 Windows 版本,但我还没有测试过。我制作了自己的版本,您可以在这里找到:
http:
//simply-embedded.blogspot.com/2014/07/code-coverage-html-reports-using-lcov.html 这是在 LCOV 1.11 版上完成的。