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

最近在做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等系统函数的覆盖率信息

上一篇:手机端图片滑动切换效果


下一篇:android ioctl fuzz,android 本地提权漏洞 android root