zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    豆瓣还是能学到东西的!
    Mip-Mapping很重要
    果然还是SB了
    Don't Starve,好脚本,好欢乐
    Soft Renderer的乐趣
    java classloader原理深究
    用gitolite搭建git server
    神话设计模式 --开端
    Dive into Spring framework -- 了解基本原理(二)--设计模式-part2
    Dive into Spring framework -- 了解基本原理(二)--设计模式-part1
  • 原文地址:https://www.cnblogs.com/jackyim/p/3732587.html
Copyright © 2011-2022 走看看