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/ '/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/

/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              tracefile.              Use this switch if you want to extract coverages data for only  a              particular  set  of  files from  a Tracefile. Additional command line              parameters is interpreted as Shell  wildcard  Patterns              (note  that  they may need to being  escaped accordingly to prevent the              shell from expanding  them first  ).   Every  file  entry  in              tracefile  which  matches at least one of those patterns would be              extracted.

Reference Link:

Lcov manual:

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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: and provide relevant evidence. A staff member will contact you within 5 working days.