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

  • 相关阅读:
    MySql常用数据操作
    使用requests+BeaBeautiful Soup爬取妹子图图片
    抓取猫眼电影排行
    Exec执行拼接字符串时遇到的问题及Sql执行函数时需要注意的事项
    c#小知识点
    MVVM 与 sql
    Dictionary
    sql表信息查询
    XAML特殊字符
    编程细节
  • 原文地址:https://www.cnblogs.com/jackyim/p/3732587.html
Copyright © 2011-2022 走看看