首页 > 移动平台 > 详细

LCOV 如何过滤iostream等系统函数的覆盖率信息

时间:2014-05-18 19:40:22      阅读:1670      评论:0      收藏:0      [点我收藏+]

最近在做cppunit test相关工作,用gcov和lcov工具来查看每行代码的覆盖率,个人感觉lcov真棒,看起来很舒服,点起来也很爽!~~

闲聊至此,如题:

我使用的是lcov的 --remove命令

Remove / filter out remaining unwanted stuff from tracefile

Now we can remove the (remaining) stuff that we aren‘t interested in from the tracefile.

lcov --remove /tmp/libreoffice_total.info ‘/usr/include/*‘ ‘/usr/lib/*‘ ‘/usr/local/src/libreoffice/*/UnpackedTarball/*‘ ‘/usr/local/src/libreoffice/workdir/*‘ ‘/usr/local/src/libreoffice/instdir/*‘ ‘/usr/local/src/libreoffice/external/*‘ -o /tmp/libreoffice_filtered.info

/usr/include/*和/usr/lib/*这两个路径加上就可以过滤掉那些系统函数的覆盖信息了(iostream等),如果想过滤其他路径,那就自己加吧!~~

 

PS: 手册中说--extract命令貌似也可以,不过我没试。

 -e tracefile pattern
       --extract tracefile pattern
              Extract data from tracefile.

              Use this switch if you want to extract coverage data for only  a
              particular  set  of  files  from a tracefile. Additional command
              line parameters will be interpreted as shell  wildcard  patterns
              (note  that  they  may need to be escaped accordingly to prevent
              the shell from expanding  them  first).   Every  file  entry  in
              tracefile  which  matches at least one of those patterns will be
              extracted.

 

参考链接:https://wiki.documentfoundation.org/Development/Lcov#patch_.27geninfo.27

lcov manual:http://ltp.sourceforge.net/coverage/lcov/lcov.1.php

LCOV 如何过滤iostream等系统函数的覆盖率信息,布布扣,bubuko.com

LCOV 如何过滤iostream等系统函数的覆盖率信息

原文:http://www.cnblogs.com/jackyim/p/3732587.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!