.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2. .TH GCOVR "1" "August 2022" "gcovr 5.2" "User Commands" .SH NAME gcovr \- generate simple coverage reports .SH DESCRIPTION usage: gcovr [options] [search_paths...] .PP A utility to run gcov and summarize the coverage in simple reports. .SH OPTIONS .TP \fB\-h\fR, \fB\-\-help\fR Show this help message, then exit. .TP \fB\-\-version\fR Print the version number, then exit. .TP \fB\-v\fR, \fB\-\-verbose\fR Print progress messages. Please include this output in bug reports. .TP \fB\-r\fR ROOT, \fB\-\-root\fR ROOT The root directory of your source files. Defaults to \&'.', the current directory. File names are reported relative to this root. The \fB\-\-root\fR is the default \fB\-\-filter\fR. .TP \fB\-a\fR ADD_TRACEFILE, \fB\-\-add\-tracefile\fR ADD_TRACEFILE Combine the coverage data from JSON files. Coverage files contains source files structure relative to root directory. Those structures are combined in the output relative to the current root directory. Unix style wildcards can be used to add the pathnames matching a specified pattern. In this case pattern must be set in double quotation marks. Option can be specified multiple times. When option is used gcov is not run to collect the new coverage data. .TP search_paths Search these directories for coverage files. Defaults to \fB\-\-root\fR and \fB\-\-object\-directory\fR. Config key: searchpath. .TP \fB\-\-config\fR CONFIG Load that configuration file. Defaults to gcovr.cfg in the \fB\-\-root\fR directory. .TP \fB\-\-no\-markers\fR Turn off exclusion markers. Any exclusion markers specified in source files will be ignored. .TP \fB\-\-fail\-under\-line\fR MIN 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. .TP \fB\-\-fail\-under\-branch\fR MIN 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. .TP \fB\-\-source\-encoding\fR SOURCE_ENCODING Select the source file encoding. Defaults to the system default encoding (UTF\-8). .TP \fB\-\-exclude\-lines\-by\-pattern\fR EXCLUDE_LINES_BY_PATTERN Exclude lines that match this regex. .TP \fB\-\-exclude\-branches\-by\-pattern\fR EXCLUDE_BRANCHES_BY_PATTERN Exclude branches that match this regex. .TP \fB\-\-exclude\-pattern\-prefix\fR EXCLUDE_PATTERN_PREFIX Define the regex prefix used in markers / line exclusions (i.e ..._EXCL_START, ..._EXCL_START, \&..._EXCL_STOP) .SS "Output Options:" .IP Gcovr prints a text report by default, but can switch to XML or HTML. .TP \fB\-o\fR OUTPUT, \fB\-\-output\fR OUTPUT Print output to this filename. Defaults to stdout. Individual output formats can override this. .TP \fB\-b\fR, \fB\-\-branches\fR Report the branch coverage instead of the line coverage. For text report only. Config key: txtbranch. .TP \fB\-\-decisions\fR Report the decision coverage. For HTML and JSON report. .TP \fB\-u\fR, \fB\-\-sort\-uncovered\fR Sort entries by increasing number of uncovered lines. For text and HTML report. .TP \fB\-p\fR, \fB\-\-sort\-percentage\fR Sort entries by increasing percentage of uncovered lines. For text and HTML report. .TP \fB\-\-txt\fR [OUTPUT] Generate a text report. OUTPUT is optional and defaults to \fB\-\-output\fR. .TP \fB\-\-cobertura\fR [OUTPUT], \fB\-x\fR [OUTPUT], \fB\-\-xml\fR [OUTPUT] Generate a Cobertura XML report. OUTPUT is optional and defaults to \fB\-\-output\fR. .TP \fB\-\-cobertura\-pretty\fR, \fB\-\-xml\-pretty\fR Pretty\-print the Cobertura XML report. Implies \fB\-\-cobertura\fR. Default: False. .TP \fB\-\-html\fR [OUTPUT] Generate a HTML report. OUTPUT is optional and defaults to \fB\-\-output\fR. .TP \fB\-\-html\-details\fR [OUTPUT] Add annotated source code reports to the HTML report. Implies \fB\-\-html\fR. OUTPUT is optional and defaults to \fB\-\-output\fR. .TP \fB\-\-html\-details\-syntax\-highlighting\fR Use syntax highlighting in HTML details page. Enabled by default. Negation: \fB\-\-no\-html\-details\-syntaxhighlighting\fR. .TP \fB\-\-html\-theme\fR THEME Override the default color theme for the HTML report. Default is green. .TP \fB\-\-html\-css\fR CSS Override the default style sheet for the HTML report. .TP \fB\-\-html\-title\fR TITLE Use TITLE as title for the HTML report. Default is \&'GCC Code Coverage Report'. .TP \fB\-\-html\-medium\-threshold\fR MEDIUM 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 \fB\-\-html\-high\-threshold\fR and greater than 0. If MEDIUM is equal to value of \fB\-\-html\-high\-threshold\fR the report has only high and low coverage. Default is 75.0. .TP \fB\-\-html\-high\-threshold\fR HIGH 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 \fB\-\-html\-mediumthreshold\fR. If HIGH is equal to value of \fB\-\-html\-mediumthreshold\fR the report has only high and low coverage. Default is 90.0. .TP \fB\-\-html\-medium\-threshold\-branch\fR MEDIUM_BRANCH If the coverage is below MEDIUM_BRANCH, the value is marked as low coverage in the HTML report. MEDIUM_BRANCH has to be lower than or equal to value of \fB\-\-html\-high\-threshold\-branch\fR and greater than 0. If MEDIUM_BRANCH is equal to value of \fB\-\-html\-mediumthreshold\-branch\fR the report has only high and low coverage. Default is taken from \fB\-\-html\-mediumthreshold\fR. .TP \fB\-\-html\-high\-threshold\-branch\fR HIGH_BRANCH If the coverage is below HIGH_BRANCH, the value is marked as medium coverage in the HTML report. HIGH_BRANCH has to be greater than or equal to value of \fB\-\-html\-medium\-threshold\-branch\fR. If HIGH_BRANCH is equal to value of \fB\-\-html\-medium\-threshold\-branch\fR the report has only high and low coverage. Default is taken from \fB\-\-html\-high\-threshold\fR. .TP \fB\-\-html\-medium\-threshold\-line\fR MEDIUM_LINE If the coverage is below MEDIUM_LINE, the value is marked as low coverage in the HTML report. MEDIUM_LINE has to be lower than or equal to value of \fB\-\-html\-highthreshold\-line\fR and greater than 0. If MEDIUM_LINE is equal to value of \fB\-\-html\-medium\-threshold\-line\fR the report has only high and low coverage. Default is taken from \fB\-\-html\-medium\-threshold\fR. .TP \fB\-\-html\-high\-threshold\-line\fR HIGH_LINE If the coverage is below HIGH_LINE, the value is marked as medium coverage in the HTML report. HIGH_LINE has to be greater than or equal to value of \fB\-\-html\-medium\-threshold\-line\fR. If HIGH_LINE is equal to value of \fB\-\-html\-medium\-threshold\-line\fR the report has only high and low coverage. Default is taken from \fB\-\-html\-high\-threshold\fR. .TP \fB\-\-html\-tab\-size\fR HTML_TAB_SIZE Used spaces for a tab in a source file. Default is 4 .TP \fB\-\-html\-absolute\-paths\fR Use absolute paths to link the \fB\-\-html\-details\fR reports. Defaults to relative links. .TP \fB\-\-html\-encoding\fR HTML_ENCODING Override the declared HTML report encoding. Defaults to UTF\-8. See also \fB\-\-source\-encoding\fR. .TP \fB\-\-html\-self\-contained\fR Control whether the HTML report bundles resources like CSS styles. Self\-contained reports can be sent via email, but conflict with the Content Security Policy of some web servers. Defaults to self\-contained reports unless \fB\-\-html\-details\fR is used. Negation: \fB\-\-nohtml\-self\-contained\fR. .TP \fB\-s\fR, \fB\-\-print\-summary\fR Print a small report to stdout with line & function & branch percentage coverage. This is in addition to other reports. Default: False. .TP \fB\-\-sonarqube\fR [OUTPUT] Generate sonarqube generic coverage report in this file name. OUTPUT is optional and defaults to \fB\-\-output\fR. .TP \fB\-\-json\fR [OUTPUT] Generate a JSON report. OUTPUT is optional and defaults to \fB\-\-output\fR. .TP \fB\-\-json\-pretty\fR Pretty\-print the JSON report. Implies \fB\-\-json\fR. Default: False. .TP \fB\-\-json\-summary\fR [OUTPUT] Generate a JSON summary report. OUTPUT is optional and defaults to \fB\-\-output\fR. .TP \fB\-\-json\-summary\-pretty\fR Pretty\-print the JSON SUMMARY report.Implies \fB\-\-jsonsummary\fR. Default: False. .TP \fB\-\-csv\fR [OUTPUT] Generate a CSV summary report. OUTPUT is optional and defaults to \fB\-\-output\fR. .TP \fB\-\-coveralls\fR [OUTPUT] Generate Coveralls API coverage report in this file name. OUTPUT is optional and defaults to \fB\-\-output\fR. .TP \fB\-\-coveralls\-pretty\fR Pretty\-print the coveralls report. Implies \fB\-\-coveralls\fR. Default: False. .TP \fB\-\-timestamp\fR TIMESTAMP Override current time for reproducible reports. Can use `YYYY\-MM\-DD hh:mm:ss` or epoch notation. Used by HTML, Coveralls, and Cobertura reports. Default: current time. .SS "Filter Options:" .IP 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. If the filter looks like an absolute path it is matched against an absolute path. Otherwise, the filter is matched against a relative path, where that path is relative to the current directory or if defined in a configuration file to the directory of the file. .TP \fB\-f\fR FILTER, \fB\-\-filter\fR FILTER Keep only source files that match this filter. Can be specified multiple times. Relative filters are relative to the current working directory or if defined in a configuration file. If no filters are provided, defaults to \fB\-\-root\fR. .TP \fB\-e\fR EXCLUDE, \fB\-\-exclude\fR EXCLUDE Exclude source files that match this filter. Can be specified multiple times. .TP \fB\-\-gcov\-filter\fR GCOV_FILTER Keep only gcov data files that match this filter. Can be specified multiple times. .TP \fB\-\-gcov\-exclude\fR GCOV_EXCLUDE Exclude gcov data files that match this filter. Can be specified multiple times. .TP \fB\-\-exclude\-directories\fR EXCLUDE_DIRS Exclude directories that match this regex while searching raw coverage files. Can be specified multiple times. .SS "GCOV Options:" .IP 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. .TP \fB\-\-gcov\-executable\fR GCOV_CMD 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'. .TP \fB\-\-include\-internal\-functions\fR Include function coverage of compiler internal functions (starting with '__' or '_GLOBAL__sub_I_'). .TP \fB\-\-exclude\-unreachable\-branches\fR Exclude branch coverage from lines without useful source code (often, compiler\-generated "dead" code). Default: False. .TP \fB\-\-exclude\-function\-lines\fR Exclude coverage from lines defining a function Default: False. .TP \fB\-\-exclude\-throw\-branches\fR For branch coverage, exclude branches that the compiler generates for exception handling. This often leads to more "sensible" coverage reports. Default: False. .TP \fB\-g\fR, \fB\-\-use\-gcov\-files\fR Use existing gcov files for analysis. Default: False. .TP \fB\-\-gcov\-ignore\-parse\-errors\fR Skip lines with parse errors in GCOV files instead of exiting with an error. A report will be shown on stderr. Default: False. .TP \fB\-\-object\-directory\fR OBJDIR 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. .TP \fB\-k\fR, \fB\-\-keep\fR Keep gcov files after processing. This applies both to files that were generated by gcovr, or were supplied via the \fB\-\-use\-gcov\-files\fR option. Default: False. Config key: keep\-gcov\-files. .TP \fB\-d\fR, \fB\-\-delete\fR Delete gcda files after processing. Default: False. Config key: delete\-gcov\-files. .TP \fB\-j\fR [GCOV_PARALLEL] Set the number of threads to use in parallel. Config key: gcov\-parallel. .PP See for the full manual.