I used the --no-external
flag together with the --directory
flag to exclude unwanted files.
The definition of external from the man:
External source files are files which are not located in one of the directories specified by –directory or –base-directory.
So my command looked like this:
$ lcov --directory src -c -o report.info --no-external
Capturing coverage data from src
Found gcov version: 4.2.1
Scanning src for .gcda files ...
Found 4 data files in src
Processing src/C####.gcda
ignoring data for external file /usr/include/c++/4.2.1/bits/allocator.h