Scroll to navigation

GCOVR(1) User Commands GCOVR(1)

NAME

gcovr - generate simple coverage reports

DESCRIPTION

usage: gcovr [options] [search_paths...]

A utility to run gcov and summarize the coverage in simple reports.

OPTIONS

Show this help message, then exit.
Print the version number, then exit.
Print progress messages. Please include this output in bug reports.
The root directory of your source files. Defaults to '.', the current directory. File names are reported relative to this root. The --root is the default --filter.
Search these directories for coverage files. Defaults to --root and --object-directory.
Exit with a status of 2 if the total line coverage is less than MIN. Can be ORed with exit status of '-- fail-under-branch' option.
Exit with a status of 4 if the total branch coverage is less than MIN. Can be ORed with exit status of '-- fail-under-line' option.
Select the source file encoding. Defaults to the system default encoding (ANSI_X3.4-1968).
If the coverage is below MEDIUM, the value is marked as low coverage in the HTML report. MEDIUM has to be lower than or equal to value of --html-high-threshold. If MEDIUM is equal to value of --html-high-threshold the report has only high and low coverage. Default is 75.0.
If the coverage is below HIGH, the value is marked as medium coverage in the HTML report. HIGH has to be greater than or equal to value of --html-mediumthreshold. If HIGH is equal to value of --html-mediumthreshold the report has only high and low coverage. Default is 90.0.

Output Options:

Gcovr prints a text report by default, but can switch to XML or HTML.
Print output to this filename. Defaults to stdout. Required for --html-details.
Report the branch coverage instead of the line coverage. For text report only.
Sort entries by increasing number of uncovered lines. For text and HTML report.
Sort entries by increasing percentage of uncovered lines. For text and HTML report.
Generate a Cobertura XML report.
Pretty-print the XML report. Implies --xml. Default: False.
Generate a HTML report.
Add annotated source code reports to the HTML report. Requires --output as a basename for the reports. Implies --html.
Use TITLE as title for the HTML report. Default is Head.
Use absolute paths to link the --html-details reports. Defaults to relative links.
Override the declared HTML report encoding. Defaults to UTF-8. See also --source-encoding.
Print a small report to stdout with line & branch percentage coverage. This is in addition to other reports. Default: False.

Filter Options:

Filters decide which files are included in the report. Any filter must match, and no exclude filter must match. A filter is a regular expression that matches a path. Filter paths use forward slashes, even on Windows.
Keep only source files that match this filter. Can be specified multiple times. If no filters are provided, defaults to --root.
Exclude source files that match this filter. Can be specified multiple times.
Keep only gcov data files that match this filter. Can be specified multiple times.
Exclude gcov data files that match this filter. Can be specified multiple times.
Exclude directories that match this regex while searching raw coverage files. Can be specified multiple times.

GCOV Options:

The 'gcov' tool turns raw coverage files (.gcda and .gcno) into .gcov files that are then processed by gcovr. The gcno files are generated by the compiler. The gcda files are generated when the instrumented program is executed.
Use a particular gcov executable. Must match the compiler you are using, e.g. 'llvm-cov gcov' for Clang. Can include additional arguments. Defaults to the GCOV environment variable, or 'gcov': 'gcov'.
Exclude branch coverage with LCOV/GCOV exclude markers. Additionally, exclude branch coverage from lines without useful source code (often, compilergenerated "dead" code). Default: False.
Use existing gcov files for analysis. Default: False.
Skip lines with parse errors in GCOV files instead of exiting with an error. A report will be shown on stderr. Default: False.
Override normal working directory detection. Gcovr needs to identify the path between gcda files and the directory where the compiler was originally run. Normally, gcovr can guess correctly. This option specifies either the path from gcc to the gcda file (i.e. gcc's '-o' option), or the path from the gcda file to gcc's working directory.
Keep gcov files after processing. This applies both to files that were generated by gcovr, or were supplied via the --use-gcov-files option. Default: False.
Delete gcda files after processing. Default: False.
Set the number of threads to use in parallel.

See <http://gcovr.com/> for the full manual.

September 2018 gcovr 4.1