LCOV How to filter coverage information for system functions such as iostream

Source: Internet
Author: User



Recently in doing Cppunit test related work, with Gcov and Lcov tools to see the coverage of each line of code, the personal feel lcov awesome, looks very comfortable, point up is also very cool! ~~



Chatting to this point, as the title:



I'm using Lcov's--remove command.


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/* and/usr/lib/* These two paths plus can filter out those system functions of the coverage information (iostream, etc.), if you want to filter other paths, then add it yourself! ~~






PS: The manual said--extract command seems to be possible, but I did not try.



-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.


 





Reference Link: https://wiki.documentfoundation.org/Development/Lcov#patch_.27geninfo.27



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


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.