Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"Can be specified multiple times. "
"If no filters are provided, defaults to --root.",
action="append",
type=FilterOption,
default=[],
),
GcovrConfigOption(
"exclude", ["-e", "--exclude"],
group="filter_options",
help="Exclude source files that match this filter. "
"Can be specified multiple times.",
action="append",
type=FilterOption.NonEmpty,
default=[],
),
GcovrConfigOption(
"gcov_filter", ["--gcov-filter"],
group="filter_options",
help="Keep only gcov data files that match this filter. "
"Can be specified multiple times.",
action="append",
type=FilterOption,
default=[],
),
GcovrConfigOption(
"gcov_exclude", ["--gcov-exclude"],
group="filter_options",
help="Exclude gcov data files that match this filter. "
"Can be specified multiple times.",
action="append",
type=FilterOption,
default=[],
"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': '{default!s}'.",
default=os.environ.get('GCOV', 'gcov'),
),
GcovrConfigOption(
"exclude_unreachable_branches", ["--exclude-unreachable-branches"],
group="gcov_options",
help="Exclude branch coverage from lines without useful source code "
"(often, compiler-generated \"dead\" code). "
"Default: {default!s}.",
action="store_true",
),
GcovrConfigOption(
"exclude_throw_branches", ["--exclude-throw-branches"],
group="gcov_options",
help="For branch coverage, exclude branches "
"that the compiler generates for exception handling. "
"This often leads to more \"sensible\" coverage reports. "
"Default: {default!s}.",
action="store_true"
),
GcovrConfigOption(
"gcov_files", ["-g", "--use-gcov-files"],
group="gcov_options",
help="Use existing gcov files for analysis. Default: {default!s}.",
action="store_true",
),
GcovrConfigOption(
"gcov_ignore_parse_errors", ['--gcov-ignore-parse-errors'],
group="gcov_options",
help="Exclude branch coverage from lines without useful source code "
"(often, compiler-generated \"dead\" code). "
"Default: {default!s}.",
action="store_true",
),
GcovrConfigOption(
"exclude_throw_branches", ["--exclude-throw-branches"],
group="gcov_options",
help="For branch coverage, exclude branches "
"that the compiler generates for exception handling. "
"This often leads to more \"sensible\" coverage reports. "
"Default: {default!s}.",
action="store_true"
),
GcovrConfigOption(
"gcov_files", ["-g", "--use-gcov-files"],
group="gcov_options",
help="Use existing gcov files for analysis. Default: {default!s}.",
action="store_true",
),
GcovrConfigOption(
"gcov_ignore_parse_errors", ['--gcov-ignore-parse-errors'],
group="gcov_options",
help="Skip lines with parse errors in GCOV files "
"instead of exiting with an error. "
"A report will be shown on stderr. "
"Default: {default!s}.",
action="store_true",
),
GcovrConfigOption(
"objdir", ['--object-directory'],
"The --root is the default --filter.",
default='.',
),
GcovrConfigOption(
"add_tracefile", ["-a", "--add-tracefile"],
help="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. "
"Option can be specified multiple times. "
"When option is used gcov is not run to collect "
"the new coverage data.",
action="append",
default=[],
),
GcovrConfigOption(
'search_paths', config='search-path',
positional=True, nargs='*',
help="Search these directories for coverage files. "
"Defaults to --root and --object-directory.",
),
GcovrConfigOption(
'config', ['--config'], config=False,
help="Load that configuration file. "
"Defaults to gcovr.cfg in the --root directory.",
),
GcovrConfigOption(
"fail_under_line", ["--fail-under-line"],
type=check_percentage,
metavar="MIN",
help="Exit with a status of 2 "
"if the total line coverage is less than MIN. "
metavar="HIGH",
help="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-medium-threshold. "
"If HIGH is equal to value of --html-medium-threshold the report has "
"only high and low coverage. Default is {default!s}.",
default=90.0,
),
GcovrConfigOption(
"relative_anchors", ["--html-absolute-paths"],
group="output_options",
help="Use absolute paths to link the --html-details reports. "
"Defaults to relative links.",
action="store_false",
),
GcovrConfigOption(
'html_encoding', ['--html-encoding'],
group="output_options",
help="Override the declared HTML report encoding. "
"Defaults to {default!s}. "
"See also --source-encoding.",
default='UTF-8',
),
GcovrConfigOption(
"print_summary", ["-s", "--print-summary"],
group="output_options",
help="Print a small report to stdout "
"with line & branch percentage coverage. "
"This is in addition to other reports. "
"Default: {default!s}.",
action="store_true",
),
"A report will be shown on stderr. "
"Default: {default!s}.",
action="store_true",
),
GcovrConfigOption(
"objdir", ['--object-directory'],
group="gcov_options",
help="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.",
),
GcovrConfigOption(
"keep", ["-k", "--keep"], config='keep-gcov-files',
group="gcov_options",
help="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: {default!s}.",
action="store_true",
),
GcovrConfigOption(
"delete", ["-d", "--delete"], config='delete-gcov-files',
group="gcov_options",
help="Delete gcda files after processing. Default: {default!s}.",
action="store_true",
),
GcovrConfigOption(
"gcov_parallel", ["-j"], config='gcov-parallel',
type=OutputOrDefault,
default=None,
const=OutputOrDefault(None),
),
GcovrConfigOption(
"json", ["--json"],
group="output_options",
metavar='OUTPUT',
help="Generate a JSON report. "
"OUTPUT is optional and defaults to --output.",
nargs='?',
type=OutputOrDefault,
default=None,
const=OutputOrDefault(None),
),
GcovrConfigOption(
"prettyjson", ["--json-pretty"],
group="output_options",
help="Pretty-print the JSON report. Implies --json. Default: {default!s}.",
action="store_true",
),
GcovrConfigOption(
"filter", ["-f", "--filter"],
group="filter_options",
help="Keep only source files that match this filter. "
"Can be specified multiple times. "
"If no filters are provided, defaults to --root.",
action="append",
type=FilterOption,
default=[],
),
GcovrConfigOption(
GCOVR_CONFIG_OPTIONS = [
GcovrConfigOption(
"verbose", ["-v", "--verbose"],
help="Print progress messages. "
"Please include this output in bug reports.",
action="store_true",
),
GcovrConfigOption(
"root", ["-r", "--root"],
help="The root directory of your source files. "
"Defaults to '{default!s}', the current directory. "
"File names are reported relative to this root. "
"The --root is the default --filter.",
default='.',
),
GcovrConfigOption(
"add_tracefile", ["-a", "--add-tracefile"],
help="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. "
"Option can be specified multiple times. "
"When option is used gcov is not run to collect "
"the new coverage data.",
action="append",
default=[],
),
GcovrConfigOption(
'search_paths', config='search-path',
positional=True, nargs='*',
help="Search these directories for coverage files. "
"Defaults to --root and --object-directory.",
),
GcovrConfigOption(
"output", ["-o", "--output"],
group="output_options",
help="Print output to this filename. Defaults to stdout. "
"Individual output formats can override this.",
default=None,
),
GcovrConfigOption(
"show_branch", ["-b", "--branches"], config='txt-branch',
group="output_options",
help="Report the branch coverage instead of the line coverage. "
"For text report only.",
action="store_true",
),
GcovrConfigOption(
"sort_uncovered", ["-u", "--sort-uncovered"],
group="output_options",
help="Sort entries by increasing number of uncovered lines. "
"For text and HTML report.",
action="store_true",
),
GcovrConfigOption(
"sort_percent", ["-p", "--sort-percentage"],
group="output_options",
help="Sort entries by increasing percentage of uncovered lines. "
"For text and HTML report.",
action="store_true",
),
GcovrConfigOption(
"xml", ["-x", "--xml"],
group="output_options",
),
GcovrConfigOption(
'config', ['--config'], config=False,
help="Load that configuration file. "
"Defaults to gcovr.cfg in the --root directory.",
),
GcovrConfigOption(
"fail_under_line", ["--fail-under-line"],
type=check_percentage,
metavar="MIN",
help="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.",
default=0.0,
),
GcovrConfigOption(
"fail_under_branch", ["--fail-under-branch"],
type=check_percentage,
metavar="MIN",
help="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.",
default=0.0,
),
GcovrConfigOption(
'source_encoding', ['--source-encoding'],
help="Select the source file encoding. "
"Defaults to the system default encoding ({default!s}).",
default=getpreferredencoding(),
),
GcovrConfigOption(
"output", ["-o", "--output"],