惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
A
About on SuperTechFans
Apple Machine Learning Research
Apple Machine Learning Research
The Register - Security
The Register - Security
Vercel News
Vercel News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
人人都是产品经理
人人都是产品经理
MyScale Blog
MyScale Blog
云风的 BLOG
云风的 BLOG
博客园_首页
U
Unit 42
T
Tailwind CSS Blog
G
GRAHAM CLULEY
F
Full Disclosure
V
Vulnerabilities – Threatpost
T
Tenable Blog
月光博客
月光博客
P
Privacy & Cybersecurity Law Blog
P
Privacy International News Feed
K
Kaspersky official blog
Scott Helme
Scott Helme
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
N
News and Events Feed by Topic
T
The Exploit Database - CXSecurity.com
N
News and Events Feed by Topic
有赞技术团队
有赞技术团队
Recent Commits to openclaw:main
Recent Commits to openclaw:main
L
LINUX DO - 最新话题
Recorded Future
Recorded Future
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Help Net Security
Help Net Security
The GitHub Blog
The GitHub Blog
Cisco Talos Blog
Cisco Talos Blog
SecWiki News
SecWiki News
P
Proofpoint News Feed
Security Latest
Security Latest
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
罗磊的独立博客
S
Security Affairs
M
MIT News - Artificial intelligence
L
LINUX DO - 热门话题
美团技术团队
Simon Willison's Weblog
Simon Willison's Weblog
T
Threat Research - Cisco Blogs
Stack Overflow Blog
Stack Overflow Blog
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
博客园 - Franky
V
Visual Studio Blog

博客园 - CoderZh

[公告]这里的博客将不再更新,最新博客请移步至blog.coderzh.com 使用ThreadSanitizer线程检查工具 使用Jekyll官方的ReadMore摘要功能 小记:《技术进步引发的灵感革命》网易游戏学院第二届公开日 强制链接静态库所有符号(包括未被使用的) 开启Github之旅 Cocos2d-x3.6 Android编译问题 读《程序员的思维训练》 最近的一些变化 成大事者不纠结 读《从0到1》 OpenWrt资料汇总 Facebook网络模拟测试工具ATC使用 为什么心跳包(HeartBeat)是必须的? DigitalOcean上使用Tornado+MongoDB+Nginx+Supervisor+DnsPod快速搭建个人博客 创业三年来的一些感想 - 创业篇1 创业三年来的一些感想 - 游戏篇 ViEmuVS2013-3.2.1 破解 从CEGUI源码看代码规范
C++开源代码覆盖率工具OpenCppCoverage介绍(Windows)
CoderZh · 2015-04-11 · via 博客园 - CoderZh

OpenCppCoverage

关于代码覆盖率统计工具,Linux平台下,gcc内置支持gcov,通过编译时加参数选项,进行代码插桩,从而实现代码覆盖率。在Windows平台下,早在几年前,我还没找到特别好用又开源的覆盖率工具,所以以前公司是自己实现了一套,使用起来也不是很方便。

最近又遇到同样的问题,不过非常幸运的是,一款开源的Windows平台的C++代码覆盖率工具出现了在我的面前:OpenCppCoverage。

OpenCppCoverage是Windows平台下开源的C++代码覆盖率工具,使用简单,功能齐全而强大。2014年才推出的,只恨没有早点发现。

使用起来非常简单,它不需要在编译时插桩,只需要有pdb文件,运行时插桩,通过OpenCppCoverage启动进程即可。

官网:https://opencppcoverage.codeplex.com/

功能也比较全,主要特点有:

  1. 不需要重新编译被测程序,只需要使用OpenCppCoverage运行程序。
  2. 性能开销比较小。
  3. 按模块、代码路径过滤。
  4. 自动生成html覆盖率结果报告。
  5. 支持多个覆盖率结果合并。
  6. 集成Jenkins

使用起来不要太简单,执行:

OpenCppCoverage.exe --sources MySourcePath -- YourProgram.exe arg1 arg2

使用文档:https://opencppcoverage.codeplex.com/documentation

Jenkins集成:https://opencppcoverage.codeplex.com/wikipage?title=Jenkins

覆盖率详细结果

OpenCppCoverage

Jenkins集成

JenkinsOpenCppCoverage