Windows 是否有任何积极支持的 lcov 端口
我使用 gcov 库测量代码的覆盖率,我想以用户友好的格式生成覆盖率报告。我找到了 lcov 实用程序,但它与 Windows 环境不兼容(主要是因为解析路径的方式)。有谁知道 Windows 上积极支持的 lcov 端口?
看起来让它在 Windows 上工作会很容易(它认为甚至可以通过一些模仿 unix shell 命令行为的创造性批处理/perl 脚本来解决),并且该工具非常有用,所以我想有人可能有已经做到了。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
这里有一个积极支持的 Windows lcov genhtml 端口: https://github.com/RickSBrown/jgenhtml 。
它是专门为跨平台运行而设计的 - 路径中的反斜杠等没有问题。
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.
虽然它可能很脏,但 lcov 似乎可以工作 在 cygwin 下。您可能还对以下问题感兴趣:如何我测量 CppUnit 测试覆盖率(在 win32 和 Unix 上)? 及其答案。 Visual Studio 似乎提供了代码覆盖率报告。
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.
还有一个 Windows 版本的 LCOV https://github.com/valbok/lcov 并解释了如何使用它。
我们在使用本机或其他版本的 LCOV 时遇到了一些问题。例如,从这里 http://simply -embedded.blogspot.com/2014/07/code-coverage-html-reports-using-lcov.html
我们的流程类似于:
使用 ARM QNX GCC 编译器在 Windows 中构建项目,收集 gcno
将二进制文件和配置复制到 QNX 下的目标并运行它们,收集 gcda 文件。
将二进制文件和配置
运行 LCOV(在 Windows 或 Linux 上)来创建报告。
如果使用本机版本的 LCOV,由于 Windows 和 Linux 路径混乱以及 LCOV 脚本内的一些错误,报告将被破坏。
我们必须对脚本进行一些修复,以避免出现目录重复、斜线、路径损坏等问题。
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:
Build a project in Windows using ARM QNX GCC compiler, collect gcno files.
Copy binaries and configs to a target under QNX and run them, collect gcda files.
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.
Fred Grott 的此处介绍了如何在 Windows 上安装 lcov使用 Chocolatey 包管理器
There is an article here by Fred Grott that shows how to install lcov on windows using the Chocolatey package manager
Donald MacQueen 在 http://www.macqueen.us/lcov.html 但我还没有测试过。
我制作了自己的版本,您可以在这里找到:
http://simply-embedded.blogspot.com/2014/07/code-coverage-html-reports-using-lcov.html
这是在 LCOV 1.11 版本上完成的。
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.