CSV Output

The --csv option output comma-separated values summarizing the coverage of each file. Consider the following command:

gcovr --csv example_csv.csv

This generates an CSV:

filename,line_total,line_covered,line_percent,branch_total,branch_covered,branch_percent,function_total,function_covered,function_percent
example.cpp,7,6,0.857,2,1,0.5,2,2,1.0

Be careful if you print the output of a CSV to STDOUT and redirect it to a file. According to RFC 4180, the line endings must be CRLF.

If the given name ends with the suffix .gz the report is compressed by gzip, if it ends with .xz it is compressed by LZMA. The file needs to be unzipped before using as input for other tools.

Added in version 5.0: Added --csv.