| lcovrc(5) | User Manuals | lcovrc(5) |
lcovrc - lcov configuration file
The lcovrc file contains configuration information for the lcov code coverage tool (see lcov(1)).
The system-wide configuration file is located at $LCOV_HOME/etc/lcovrc. This is typically either /etc/lcovrc or /usr/local/etc/lcovrc but may be wherever you have installed the lcov package. To change settings for a single user, place a customized copy of this file at location ~/.lcovrc. Where available, command-line options override configuration file settings.
The genhtml, lcov, and geninfo commands also support the --config-file option, which can be used to specify one or more files which should be used instead of the system or user default rc files. Multiple options files may be useful if you have both project- and team-specific common options and want to ensure consistency across multiple users. If multiple --config-file options are applied in the order they appear. Note that the "--config-file" option name must be specified in full and cannot be abbreviated. An error will occur if the option is not recognized.
Lines in a configuration file can either be:
'key = ...$ENV{ENV_VAR_NAME}...'.
The substring '$ENV{ENV_VAR_NAME}' is replaced by the value of the environment variable.
One or more environment variables may be used to set the RC value.
A list of valid statements and their description can be found in
section 'OPTIONS' below.
NOTE that there is no error checking of keys in the options file:
spelling errors are simply seen as values which are not used by some
particular tool. If you are unsure of whether your options file is read or
its values applied, you can use the --verbose --verbose flag to
enable printing of option value overrides. (The option appears twice to
enable a higher level of verbosity.)
Both 'list' and 'scalar' (non list) options are supported in the lcovrc file.
For scalar (non list) options:
For list options:
Example configuration:
Note that this example does not include all possible configuration
options.
In general: (almost) all command line options can be specified in the
configuration file instead, whereas some configuration file options have no
command line equivalent.
See the OPTIONS section below for details.
# External style sheet file
#genhtml_css_file = gcov.css
# Use 'dark' mode display (light foreground/dark background)
# rather than default
#genhtml_dark_mode = 1
# Alternate header text to use at top of each page
#genhtml_header = Coverage report for my project
# Alternate footer text to use at the bottom of each page
#genhtml_footer = My footer text
# Coverage rate limits
genhtml_hi_limit = 90
genhtml_med_limit = 75
# Ignore some errors (comma-separated list)
#ignore_errors = empty,mismatch
# Stop emitting message after this number have been printed
# 0 == no limit
max_message_count = 100
# If nonzero, do not stop when an 'ignorable error' occurs -
try
# to generate a result, however flawed. This is equivalent to
# the '--keep-going' command line switch.
# Default is 1: stop when error occurs
#stop_on_error = 1
# If nonzero, treat warnings as error
# note that ignored messages will still appear as warnings
# Default is 0
#treat_warning_as_error = 1
# If set to non-zero, only issue particular warning once per
file
# Default is 1
#warn_once_per_file = 1
# extension associated with lcov trace files - glob match
pattern
# used as argument to 'find' - to find coverage files contained in
# a directory argument
#info_file_pattern = *.info
# list of file extensions which should be treated as C/C++
code
# (comma-separated list)
#c_file_extensions = h,c,cpp,hpp
# list of file extensions which should be treated as RTL code
# (e.g., Verilog) (comma-separated list)
#rtl_file_extensions = v,vh,sv
# list of file extensions which should be treated as Java code
#java_file_extensions = java
# list of file extensions which should be treated as perl code
#perl_file_extensions = pl,pm
# list of file extensions which should be treated as python
code
#python_file_extensions = py
# maximum number of lines to look at, when filtering bogus
branch expressions
#filter_lookahead = 5
# if nonzero, bitwise operators '|', '&', '~' indicate
conditional expressions
#filter_bitwise_conditional = 1
# if nonzero, '--filter blank' is applied to blank lines, regardless
# of their hit count
#filter_blank_aggressive = 1
# Width of line coverage field in source code view
genhtml_line_field_width = 12
# Width of branch coverage field in source code view
genhtml_branch_field_width = 16
# Width of MC/DC coverage field in source code view
genhtml_mcdc_field_width = 14
# width of 'owner' field in source code view - default is 20
genhtml_owner_field_width = 20
# width of 'age' field in source code view - default is 5
genhtml_age_field_width = 5
# Width of overview image
genhtml_overview_width = 80
# Resolution of overview navigation
genhtml_nav_resolution = 4
# Offset for source code navigation
genhtml_nav_offset = 10
# Do not remove unused test descriptions if non-zero
genhtml_keep_descriptions = 0
# Do not remove prefix from directory names if non-zero
genhtml_no_prefix = 0
# Do not create source code view if non-zero
genhtml_no_source = 0
# Specify size of tabs
genhtml_num_spaces = 8
# Include color legend in HTML output if non-zero
genhtml_legend = 0
# Include HTML file at start of HTML output
#genhtml_html_prolog = prolog.html
# Include HTML file at end of HTML output
#genhtml_html_epilog = epilog.html
# Use custom HTML file extension
#genhtml_html_extension = html
# Compress all generated html files with gzip.
#genhtml_html_gzip = 1
# Include sorted overview pages
genhtml_sort = 1
# Display coverage data in hierarchical directory structure
# (rather than flat/3 level)
#genhtml_hierarchical = 1
# Display coverage data using 'flat' view
#genhtml_flat_view = 1
# Specify the character set of all generated HTML pages
genhtml_charset=UTF-8
# Allow HTML markup in test case description text if non-zero
genhtml_desc_html=0
# Specify the precision for coverage rates
#genhtml_precision=1
# Show missed counts instead of hit counts
#genhtml_missed=1
# group function aliases in report - see '--merge' section in
man(1) genhtml
#merge_function_aliasess = 1
# If set, suppress list of aliases in function detail table
#suppress_function_aliases = 1
# If set, derive function end line from line coverpoint data -
default ON
#derive_function_end_line = 1
# If set, derive function end lines for all file types. # By
default, we derive end lines for C/C++ files only #
#derive_end_line_all_files = 0
# Maximum size of function (number lines) which will be
checked by '--filter trivial'
#trivial_function_threshold = 5
# Set threshold for hit count which tool should deem likely to
indicate
# a toolchain bug (corrupt coverage data)
# excessive_count_theshold = number
# Demangle C++ symbols
# Call multiple times to specify command and command line arguments
# ('-Xlinker'-like behaviour)
#demangle_cpp = c++filt
# Name of the tool used for demangling C++ function names
# This argument is deprecated - please use demangle_cpp' instead
#genhtml_demangle_cpp_tool = c++filt
# Specify extra parameters to be passed to the demangling tool
# this argument is deprecated - use Xlinker-like demangle_cpp
# parameter instead
#genhtml_demangle_cpp_params = ""
# Location of the gcov tool
#geninfo_gcov_tool = gcov
# Adjust test names if non-zero
#geninfo_adjust_testname = 0
# Ignore testcase names in .info file forget_testcase_names = 0
# Calculate and/or compute checksum for each line if non-zero
checksum = 0
# Enable libtool compatibility mode if non-zero
geninfo_compat_libtool = 0
# Specify whether to capture coverage data for external source
# files
#geninfo_external = 1
# Specify whether to capture coverage data from compile-time
data files
# which have no corresponding runtime data.
#geninfo_capture_all = 1
# Use gcov's --all-blocks option if non-zero
#geninfo_gcov_all_blocks = 1
# Adjust 'executed' non-zero hit count of lines which contain
no branches
# and have attribute '"unexecuted_blocks": true'
#geninfo_unexecuted_blocks = 0
# Specify compatibility modes (same as --compat option
# of geninfo)
#geninfo_compat = libtool=on, hammer=auto, split_crc=auto
# Adjust path to source files by removing or changing path
# components that match the specified pattern (Perl regular
# expression format)
#geninfo_adjust_src_path = /tmp/build => /usr/src
# Specify if geninfo should try to automatically determine
# the base-directory when collecting coverage data.
geninfo_auto_base = 1
# Use gcov intermediate format? Valid values are 0, 1, auto
geninfo_intermediate = auto
# Specify if exception branches should be excluded from branch
coverage.
no_exception_branch = 0
# Directory containing gcov kernel files
lcov_gcov_dir = /proc/gcov
# Location for temporary directories
lcov_tmp_dir = /tmp
# Show full paths during list operation if non-zero
lcov_list_full_path = 0
# Specify the maximum width for list output. This value is
# ignored when lcov_list_full_path is non-zero.
lcov_list_width = 80
# Specify the maximum percentage of file names which may be
# truncated when choosing a directory prefix in list output.
# This value is ignored when lcov_list_full_path is non-zero.
lcov_list_truncate_max = 20
# Specify if function coverage data should be collected,
processed, and
# displayed.
function_coverage = 1
# Specify if branch coverage data should be collected,
processed, and
# displayed.
branch_coverage = 0
# Specify if Modified Condition / Decision Coveage data should
be collected,
# processed, and displayed.
mcdc_coverage = 0
# Ask lcov/genhtml/geninfo to return non-zero exit code if
branch coverage is
# below specified threshold percentage.
fail_under_branches = 75.0
# Ask lcov/genhtml/geninfo to return non-zero exit code if
line coverage is
# below specified threshold percentage.
#fail_under_lines = 97.5
# Specify JSON module to use, or choose best available if
# set to auto
lcov_json_module = auto
# Specify maximum number of parallel slaves
# default: 1 (no parallelism)
#parallel = 1
# Specify maximum memory to use during parallel processing, in
Mb.
# Do not fork if estimated memory consumption exceeds this number.
# default: 0 (no limit)
#memory = 1024
# Specify the number of consecutive fork() failures to allow
before
# giving up
# max_fork_fails = 5
# Seconds to wait after failing to fork() before retrying
# fork_fail_timeout = 10
# Throttling control: specify a percentage of system memory to
use as
maximum during parallel processing.
# Do not fork if estimated memory consumption exceeds the maximum.
# this value is used only if the maximum memory is not set.
# default: not set
#memory_percentage = 75
# Character used to split list-type parameters
# - for example, the list of "--ignore_errors source,mismatch"
# default: , (comma)
#split_char = ,
# use case insensitive compare to find matching files, for
include/exclude
# directives, etc
#case_insensitive = 0
# override line default line exclusion regexp
#lcov_excl_line = LCOV_EXCL_LINE
# override branch exclusion regexp
#lcov_excl_br_line = LCOV_EXCL_BR_LINE
# override exception branch exclusion regexp
#lcov_excl_exception_br_line = LCOV_EXCL_EXCEPTION_BR_LINE
# override start of exclude region regexp
#lcov_excl_start = LCOV_EXCL_START
# override end of exclude region regexp
#lcov_excl_stop = LCOV_EXCL_STOP
# override start of branch exclude region regexp
#lcov_excl_br_start = LCOV_EXCL_BR_START
# override start of exclude region regexp
#lcov_excl_br_stop = LCOV_EXCL_BR_STOP
# override start of exclude region regexp
#lcov_excl_exception_br_start = LCOV_EXCL_EXCEPTION_BR_START
# override start of exclude region regexp
#lcov_excl_exception_br_stop = LCOV_EXCL_EXCEPTION_BR_STOP
genhtml_css_file = filename
This option corresponds to the --css-file command line option of genhtml.
By default, a standard CSS file is generated.
genhtml_header = string
Specify header text to use ta top of each HTML page.
This option corresponds to the --header-title command line
option of genhtml.
Default is "LCOV - (differential )? coverage report"
genhtml_footer = string
This option corresponds to the --footer command line option of genhtml.
Default is LCOV tool version string.
genhtml_dark_mode = 0|1
This option corresponds to the --dark-mode command line option of genhtml.
By default, a 'light' palette is used.
genhtml_hi_limit = hi_limit
genhtml_med_limit = med_limit
High: hi_limit <= rate <= 100 default color: green
Medium: med_limit <= rate < hi_limit default color: yellow
Low: 0 <= rate < med_limit default color: red
Defaults are 90 and 75 percent.
There are also options to configure different thresholds for line, branch, and function coverages. See below.
genhtml_line_hi_limit = line_hi_limit
genhtml_line_med_limit = line_med_limit
genhtml_branch_hi_limit = branch_hi_limit
genhtml_branch_med_limit = branch_med_limit
genhtml_function_hi_limit = function_hi_limit
genhtml_function_med_limit = function_med_limit
rtl_file_extensions = str[,str]+
If not specified, the default set is 'v,vh,sv,vhdl?'. There is
no command line option equivalent.
This option is used by genhtml and lcov.
info_file_pattern = str
c_file_extensions = str[,str]+
If not specified, the default set is 'c,h,i,C,H,I,icc,cpp,cc,cxx,hh,hpp,hxx'. If you want all files to be treated as C/C++ code, you can use: c_file_extensions = .*
This parameter must be set from the lcovrc file or via the --rc name=value command line option; note that you may need to protect the value from shell expansion in the latter case.
java_file_extensions = str[,str]+
If not specified, the default set is 'java'. If you want all files to be treated as Java code, you can use: java_file_extensions = .*
This parameter must be set from the lcovrc file or via the --rc name=value command line option; note that you may need to protect the value from shell expansion in the latter case.
perl_file_extensions = str[,str]+
If not specified, the default set is 'pl,pm'. If you want all files to be treated as Perl code, you can use: perl_file_extensions = .*
This parameter must be set from the lcovrc file or via the --rc name=value command line option; note that you may need to protect the value from shell expansion in the latter case.
python_file_extensions = str[,str]+
If not specified, the default set is 'py'. If you want all files to be treated as Python code, you can use: python_file_extensions = .*
This parameter must be set from the lcovrc file or via the --rc name=value command line option; note that you may need to protect the value from shell expansion in the latter case.
filter_lookahead = integer
If not specified, the default set is 10. There is no command
line option equivalent.
This option is used by genhtml and lcov.
filter_bitwise_conditional = 0|1
If not specified, the default set is 0 (do not treat them as
conditional). There is no command line option equivalent.
This option is used by genhtml and lcov.
filter_blank_aggressive = 0|1
If not specified, the default set is 0 (filter blank lines
only if they are not hit).
There is no command line option equivalent.
ignore_errors = message_type(,message_type)*
This option can be used multiple times in the lcovrc file to ignore multiple message types.
This option is equivalent to the --ignore-errors option to
geninfo, genhtml, or lcov. Note that the lcovrc file message list is not
applied (those messages NOT ignored) if the '--ignore-errors' command
line option is specified.
This option is used by genhtml, lcov, and geninfo.
expect_message_count = message_type:expr(,message_type:expr)*
Multiple constraints can be specified using a comma-separated list or by using the option multiple times.
Substitutions are performed on the expression before it is evaluated:
For example:
This option is useful if errors are caused by conditions that you cannot fix - for example, due to inconsistent coverage data generated by your toolchain. In those scenarios, you may decide:
In the latter case, this option provides some additional safety by warning you when the count differs due to some change which occurred, giving you the opportunity to diagnose the change and/or to review message changes.
This option is equivalent to the --expect-message-count command line flag.
max_message_count = integer
No more warnings will be printed after this number is reached.
0 (zero) is interpreted as 'no limit'.
This option is used by genhtml, lcov, and geninfo.
stop_on_error = 0|1
This is equivalent to the '--keep-going' command line option.
Default is 1: stop when error occurs.
If the 'ignore_error msgType' option is also used, then those messages will be treated as warnings rather than errors (or will be entirely suppressed if the message type appears multiple times in the ignore_messages option). Warnings do not cause a non-zero exit status.
This option is used by genhtml, lcov, and geninfo.
treat_warning_as_error = 0|1
Note that ignored messages will still appear as warnings: see the ignore_errors entry, above.
This option is used by genhtml, lcov, and geninfo.
warn_once_per_file = 0|1
Default is 1: do not report additional errors.
This option is used by genhtml, lcov, and geninfo.
check_data_consistency = 0|1
It may be useful to use this option to disable checking if you have inconsistent legacy data and have no way to correct or exclude it.
Default is 1: execute consistency checks.
genhtml_line_field_width = number_of_characters
Default is 12.
genhtml_branch_field_width = number_of_characters
Default is 16.
genhtml_mcdc_field_width = number_of_characters
Default is 14.
genhtml_owner_field_width = number_of_characters
Default is 20.
genhtml_age_field_width = number_of_characters
Default is 5.
genhtml_frames = 0 | 1
genhtml_overview_width = pixel_size
Default is 80.
genhtml_nav_resolution = lines
Default is 4.
genhtml_nav_offset = lines
Clicking a line in the overview image should show the source code view at a position a bit further up, so that the requested line is not the first line in the window. This number specifies that offset.
Default is 10.
genhtml_keep_descriptions = 0|1
This option corresponds to the --keep-descriptions option of genhtml.
Default is 0.
genhtml_no_prefix = 0|1
This option corresponds to the --no-prefix option of genhtml.
Default is 0.
genhtml_no_source = 0|1
This option corresponds to the --no-source option of genhtml.
Default is 0.
genhtml_num_spaces = num
This option corresponds to the --num-spaces option of genhtml.
Default is 8.
genhtml_legend = 0|1
This option corresponds to the --legend option of genhtml.
Default is 0.
genhtml_html_prolog = filename
This option corresponds to the --html-prolog option of genhtml.
Default is to use no extra prolog.
genhtml_html_epilog = filename
This option corresponds to the --html-epilog option of genhtml.
Default is to use no extra epilog.
genhtml_html_extension = extension
This option corresponds to the --html-extension option of genhtml.
Default extension is "html".
genhtml_html_gzip = 0|1
This option corresponds to the --html-gzip option of genhtml.
Default extension is 0.
genhtml_sort = 0|1
This option can be set to 0 by using the --no-sort option of genhtml.
Default is 1.
genhtml_hierarchical = 0|1
This option is equivalent to using the --hierarchical command line option of genhtml.
Default is 0.
genhtml_flat_view = 0|1
This option is equivalent to using the --flat command line option of genhtml.
Default is 0.
genhtml_show_navigation = 0|1
This option is equivalent to using the --show-navigation command line option of genhtml.
Default is 0.
genhtml_show_owner_table = 0|1|all
Default is 0.
compact_summary_tables = 0|1
Default is 1 (enabled).
owner_table_entries = integer
This option has no effect unless genhtml --show-owners is enabled. See the --show-owners option in genhtml(1) for details.
Default is not set ( i.e., do not truncate owner tables).
truncate_owner_table = comma_separated_list
This option has no effect unless genhtml --show-owners is enabled and and the owner_table_entries configuration is set.
If this option is set multiple times in the lcovrc file, the values are combined to form the list of levels where truncation will occur. Similarly, if this option is not set and owner_table_entries is set, then the table will be truncated everywhere.
See the --show-owners option in genhtml(1) for details.
Default is to not truncate the list.
genhtml_show_noncode_owners = 0|1
Default is 0.
genhtml_show_function_proportion = 0|1
If nonzero, add column to "function coverage detail" table to show the proportion of lines and branches within the function which are exercised.
This option is equivalent to using the --show-proportion command line option of genhtml.
Default is 0.
genhtml_synthesize_missing = 0|1
Default is 0.
genhtml_charset = charset
Use this option if the source code contains characters which are not part of the default character set. Note that this option is ignored when a custom HTML prolog is specified (see also genhtml_html_prolog).
Default is UTF-8.
demangle_cpp = c++filt
If the demangle_cpp option is used multiple times, then the arguments are concatenated when the callback is executed - similar to how the gcc -Xlinker parameter works. This provides a possibly easier way to pass arguments to your tool, without requiring a wrapper script. In that case, your callback will be executed as: | tool-0 'tool-1; ... Arguments are quoted when passed to the shell, in order to handle parameters which contain spaces.
Note that the demangling tool is called via a pipe, and is expected to read from stdin and write to stdout.
This option corresponds to the --demangle-cpp command line option of genhtml.
Default is not set (C++ demangling is disabled).
genhtml_demangle_cpp_tool = path_to_c++filt
This option is deprecated and will be removed from a future lcov release. Please use demangle_cpp = path_to_c++filt instead.
genhtml_demangle_cpp_params = parameters
Use this option if your environment requires additional parameters such as --no-strip-underscore for correctly demangling C++ internal function names. See also c++filt(1)).
This argument is deprecated. Please use the Xlinker-like demangle_cpp argument instead.
genhtml_desc_html = 0|1
Set this option to one if you want to embed HTML markup (for example to include links) in test case descriptions. When set to zero, HTML markup characters will be escaped to show up as plain text on the test case description page.
Default is 0.
genhtml_precision = 1|2|3|4
Default is 1.
merge_function_aliases = 0|1
Default is 0.
genhtml_missed = 0|1
Default is 0.
suppress_function_aliases = 0|1
Default is 0.
derive_function_end_line = 0|1
Default is 1.
This option is not required if you are using gcc/9 or newer; these versions report function begin/end lines directly.
Note that end lines are derived only for C/C++ files unless
the derive_function_end_lines_all_files option is enabled; see
the c_file_extensions setting, above, for the list of extensions
used to identify C/C++ these files.
Lambda functions are ignored during end line computation. Note that
lambdas are identified via function name matching - so you must enable
demangling if your toolchain is too old to report demangled names in the
GCOV output. See the demangle_cpp setting, above.
For languages other than C/C++: end-line derivation may
compute the wrong value - e.g., in cases where there are lines of
code in global scope following some function definition. In this case,
lcov will incorrectly associate the following code with the preceding
function.
If this creates problems - for example, causes lcov to warn about
inconsistent coveage data - then there are several possible
workarounds:
derive_function_end_line_all_files = 0|1
Default is 0 (disabled).
trivial_function_threshold = integer
Default is 5.
excessive_count_threshold = number
Default is not set. (Do not check for excessive counts.)
geninfo_gcov_tool = path_to_gcov
This option can be used multiple times - e.g., to add arguments to the gcov callback. See the geninfo man page for details.
geninfo_adjust_testname = 0|1
Default is 0.
forget_testcase_names = 0|1
This is equivalent to the "--forget-test-names" lcov/genhtml option.
Default is 0.
geninfo_checksum = 0|1
checksum = 0|1
The backward compatible geninfo_checksum option is deprecated. Please use checksum instead. The new option is preferred as it is more clear that the option is used by lcov and genhtml as well as geninfo,
This option can be overridden by the --checksum and --no-checksum command line options.
Default is 0.
Note that this options is somewhat subsumed by the version_script option - which does something similar, but at the 'whole file' level.
geninfo_compat_libtool = 0|1
This option corresponds to the --compat-libtool and --no-compat-libtool command line option of geninfo.
Default is 1.
geninfo_external = 0|1
External source files are files which are not located in one of the directories (including sub-directories) specified by the --directory or --base-directory options of lcov/geninfo. Also see the --follow option and the geninfo_follow_symlinks and geninfo_follow_file_links for additional path controls.
Default is 1.
geninfo_capture_all = 0|1
Default is 0: do not process bare compile-time data files.
geninfo_external = 0|1
External source files are files which are not located in one of the directories (including sub-directories) specified by the --directory or --base-directory options of lcov/geninfo. Also see the --follow option and the geninfo_follow_file_links for additional path controls.
Default is 1.
geninfo_follow_symlinks = 0|1
Default is 0: do not modify follow symbolic links.
geninfo_follow_file_links = 0|1
Default is 0: do not modify pathnames.
geninfo_gcov_all_blocks = 0|1
Using --all-blocks will produce more detailed branch coverage information for each line. Set this option to zero if you do not need detailed branch coverage information to speed up the process of capturing code coverage or to work around a bug in some versions of gcov which will cause it to endlessly loop when analyzing some files.
Default is 1.
geninfo_unexecuted_blocks = 0|1
Note that this option is effective only for gcov versions 9 and newer.
Default is 0.
geninfo_compat = mode=value[,mode=value,...]
This option corresponds to the --compat command line option of geninfo.
Default is 'libtool=on, hammer=auto, split_crc=auto'.
geninfo_adjust_src_path = pattern =>
replacement
geninfo_adjust_src_path = pattern
Use this option in situations where geninfo cannot find the correct path to source code files of a project. By providing a pattern in Perl regular expression format (see perlre(1)) and an optional replacement string, you can instruct geninfo to remove or change parts of the incorrect source path.
Example:
1. When geninfo reports that it cannot find source file
/path/to/src/.libs/file.c
while the file is actually located in
/path/to/src/file.c
use the following parameter:
geninfo_adjust_src_path = /.libs
This will remove all "/.libs" strings from the path.
2. When geninfo reports that it cannot find source file
/tmp/build/file.c
while the file is actually located in
/usr/src/file.c
use the following parameter:
geninfo_adjust_src_path = /tmp/build => /usr/src
This will change all "/tmp/build" strings in the path to "/usr/src".
The adjust_src_path option is similar to the substitution = ... option - which is somewhat more general and allows you to specify multiple substitution patterns. Also see the resolve_script option.
source_directory = dirname
Add 'dirname' to the list of places to look for source files. Also see the --source-directory entry in the lcov, geninfo, and genhtml man pages.
For relative source file paths e.g., found in some tracefile or in gcov output, first look for the path from 'cwd' (where genhtml was invoked) and then from each alternate directory name in the order specified. The first location matching location is used.
This option can be specified multiple times, to add more directories to the source search path.
Note that the command line option overrides the RC file entries (if any).
build_directory = dirname
Add 'dirname' to the list of places to look for matching GCNO files (geninfo) or source file soft links (genhtml). See the the --build-directory description in the geninfo and in the genhtml man page.
This option can be specified multiple times, to add more directories to the source search path.
Note that the command line option overrides the RC file entries (if any).
geninfo_auto_base = 0|1
Use this option when using geninfo on projects built with libtool or similar build environments that work with multiple base directories, i.e. environments, where the current working directory when invoking the compiler is not the same directory in which the source code file is located, and in addition, is different between files of the same project.
Default is 1.
geninfo_intermediate = 0|1|auto
Use this option to control whether geninfo should use the gcov intermediate format while collecting coverage data. The use of the gcov intermediate format should increase processing speed. It also provides branch coverage data when using the --initial command line option.
Valid values are 0 for off, 1 for on, and "auto" to let geninfo automatically use immediate format when supported by gcov.
Default is "auto".
geninfo_no_exception_branch = 0|1
no_exception_branch = 0|1
This option is used by lcov, geninfo, genhtml.
The value no_exception_branch = 1 is equivalent to the --filter exception command line option.
The backward compatible geninfo_no_exception_branch option is deprecated. Please use no_exception_branch instead. The new option is preferred as it is more clear that the option is used by lcov and genhtml as well as geninfo,
Default is 0.
geninfo_chunk_size = integer[%]
The default is 80% of total_number_of_gcda_files / maximum_number_of_parallel_children, the average number of files expected to be processed by each child. See the --parallel entry in the geninfo man page.
The argument may be either an integer value to be used as the chunk size or a percentage of the average number files processed per child.
This option has no effect unless the --parallel option has been specified.
geninfo_interval_update = integer
The default is 5%.
This option has no effect unless the --parallel option has been specified.
lcov_filter_chunk_size = integer[%]
The default is 80% of total_number_of_source_files / maximum_number_of_parallel_children.
The argument may be either an integer value to be used as the chunk size or a percentage of the average number files processed per child.
This option has no effect unless the --parallel option has been specified and lcov_filter_parallel is not zero.
lcov_filter_parallel = 0 | 1
This option specifies whether coverpoint filtering should be done serially or in parallel. If the number of files to process is very large, then parallelization may improve performance.
This option has no effect unless the --parallel option has been specified.
The default is 1 (enabled).
lcov_gcov_dir = path_to_kernel_coverage_data
Default is auto-detection.
lcov_tmp_dir = temp
Default is '/tmp'.
lcov_list_full_path = 0|1
This option corresponds to the --list-full-path option of lcov.
Default is 0.
lcov_list_max_width = width
Default is 80.
lcov_list_truncate_max = percentage
Default is 20.
function_coverage = 0|1
Turning off function coverage by setting this option to 0 can sligly reduce memory and CPU time consumption when lcov is collecting and processing coverage data, as well as reduce the size of the resulting data files.
This option can be overridden by the --function-coverage and --no-function-coverage command line options.
Backward-compatible RC options lcov_function_coverage and genhtml_function_coverage are supported but deprecated. Please use the new option instead.
Default is 1.
branch_coverage = 0|1
Turning off branch coverage by setting this option to 0 can reduce memory and CPU time consumption when lcov is collecting and processing coverage data, as well as reduce the size of the resulting data files.
This option can be overridden by the --branch-coverage
and --no-branch-coverage
command line options.
Backward-compatible RC options lcov_branch_coverage and genhtml_branch_coverage are supported but deprecated. Please use the new option instead.
Default is 0.
mcdc_coverage = 0|1
Turning off MC/DC coverage by setting this option to 0 can reduce memory and CPU time consumption when lcov is collecting and processing coverage data, as well as reduce the size of the resulting data files.
This option can be overridden by the --mcdc-coverage
command line option.
Default is 0 (not enabled).
See the MC/DC section of man genhtml(1) for more details
lcov_excl_line = expression
There are at least 2 (moderately) common use cases for custom
exclusion markers:
- You are using multiple tools for coverage analysis, each of which has
its own directives, and you don't want to complicate your source code
with directives for each of them.
- You want to exclude different regions/different types of code in
different contexts - for example, to ignore or not ignore debug/trace
code depending on your team.
Default is 'LCOV_EXCL_LINE'.
lcov_excl_br_line = expression
Default is 'LCOV_EXCL_BR_LINE'.
lcov_excl_exception_br_line = expression
Also see 'geninfo_no_exception_branch'; if nonzero, then all identified exception branches will be removed.
Note that this feature requires support from your compiler - and thus may not ignore all exception-related coverpoints.
Default is 'LCOV_EXCL_EXCEPTION_BR_LINE'.
lcov_excl_start = expression
Default is 'LCOV_EXCL_START'.
lcov_excl_stop = expression
Default is 'LCOV_EXCL_STOP'.
lcov_excl_br_start = expression
Default is 'LCOV_EXCL_BR_START'.
lcov_excl_br_stop = expression
Default is 'LCOV_EXCL_BR_STOP'.
lcov_excl_exception_br_start = expression
Also see 'geninfo_no_exception_branch'; if nonzero, then all identified exception branches will be removed.
Note that exception branch coverpoint identification requires support from your compiler - and thus may not ignore all exception-related coverpoints.
Default is 'LCOV_EXCL_EXCEPTION_BR_START'.
lcov_excl_exception_br_stop = expression
Default is 'LCOV_EXCL_EXECEPTION_BR_STOP'.
fail_under_branches = percentage
This option is equivalent to the --fail-under-branches lcov/genhtml/geninfo command line argument. See man lcov(1) for more detailes.
The default is 0 (no threshold).
fail_under_lines = percentage
This option is equivalent to the --fail-under-lines lcov/genhtml/geninfo command line argument.
The default is 0 (no threshold).
profile = filename
If filename is empty, then the profile is written to the default location chosen by the application.
This option is used by genhtml, lcov, and geninfo.
The default is unset: no data generated.
parallel = integer
This option is used by genhtml, lcov, and geninfo.
memory = integer_Mb
This option is used by genhtml, lcov, and geninfo.
memory_percentage = number
The default is not not set.
This option is used by genhtml, lcov, and geninfo.
max_fork_fails = integer
The default fork failure maximum is 5.
fork_fail_timeout = integer_seconds
The default is 10 (seconds).
max_tasks_per_core = integer
The default is 20.
genhtml_date_bins = integer[,integer..]
This option can be used multiple times in the lcovrc file to set multiple cutpoints.
genhtml_datelabels = string[,string..]
This option can be used multiple times in the lcovrc file to set multiple labels. The number of labels should equal one greater than number of cutpoints.
genhtml_annotate_script = path_to_executable|parameter
This option can be used multiple times in the lcovrc file to specify both an annotation script and additional options which are passed to the script.
See the genhtml man page for details.
genhtml_annotate_tooltip = tooltip_string
This option sets the 'tooltip' popup which appears if user hovers mouse over the associated source code. Note that the tooltop is generated only if the annotation-script callback is successful and returns a commit ID other than "NONE". Set tooltip_string to "" (empty string) to force genhtml to not produce the tooltip.
Substitutions are performed on tooltip_string:
context_script = path_to_executable_or_module|parameter
This option can be used multiple times in the lcovrc file to specify both a criteria script and additional options which are passed to the script.
See the genhtml man page for details.
criteria_script = path_to_executable_or_module|parameter
This option can be used multiple times in the lcovrc file to specify both a criteria script and additional options which are passed to the script.
See the genhtml man page for details.
criteria_callback_data = comma_separated_list
Note that lcov and geninfo do not record date or owner data - and so do not pass it to the callback.
This option can be used multiple times in the lcovrc file to specify both date and owner data should be returned, or you can specify both in a comma-separated list. Date and/or owner data will be returned if and only if your genhtml command has enabled annotation.
If this option is appears multiple times in the lcovrc file; the values are combined to form the list of binning types which are passed to your callback.
See the genhtml man page for details.
criteria_callback_levels = comma_separated_list
If this option is appears multiple times in the lcovrc file, the values are combined to form the list of report levels when your callback will be executed.
See the genhtml man page for details.
check_existence_before_callback = 0|1
You may want to NOT check for file existence if your callback looks up information in a non-local repository.
The default is 1 (check for file existence).
compute_file_version = 0|1
Note that this option has no effect without a version-script callback - defined by either the --version-script command line option or the version_script config file option.
The default is 0: do not generate missing information.
version_script = path_to_executable|parameter
This option can be used multiple times in the lcovrc file to specify both a version script and additional options which are passed to the script.
See the genhtml man page for details.
resolve_script = path_to_executable|parameter
This option can be used multiple times in the lcovrc file to specify both a resolve script and additional options which are passed to the script.
The resolve script provides a mechanism to find a source or data file that cannot be found by simply modify paths via substitution patterns (see substitute = replace_regexp above) and searching along the corresponding directory list:
or
to initialize the callback, then
to find the actual file location.
If necessary, the callback can check the suffix of the filename to determine whether it should look for either a source or data file.
The script should return either empty string (file not found/no such file) or the actual path name. The returned path may be either absolute or relative to CWD.
select_script = path_to_executable|parameter
This option can be used multiple times in the lcovrc file to specify both a select script and additional options which are passed to the script.
The select script provides a mechanism to decide whether a particular source line is interesting - whether it should be included in the generated coverage report - or not.
Lines which are not selected but fall within num_context_lines of a selected line are also included in the report. See below.
Note that selection is fundamentally intended to show regions of code with some surrounding context. It might not do what you expect if there is no code - e.g., if the region of interest has been compiled out via compiler or exclusion directives. For example: when selecting based on SHA or changelist ID, an inserted comment will not be selected unless it is within num_context_lines of an inserted or changed line of code.
The select script is called as:
select_script [callback_args] lineDataJson annotateDataJson fileName lineNumber
or as:
$selectCallback = select_module ->new([callback_args])
to initialize the callback object, then as
$selectCallback select (lineDataRef annotateDataRef fileName lineNumber)
The module callback is similar except that is is passed objects rather than JSON encodings of the objects.
The script should return "1" or "0".
See example implementation $LCOV_HOME/share/lcov/support-scripts/select.pm.
num_context_lines = integer
filter = str[,str...]
This option is equivalent to the --filter option to geninfo, lcov, and genhtml. See the genhtml man page for details.
This option can be used multiple times in the lcovrc file to enable multiple filters. The filters specified in the lcovrc file are appended to the list specified on the command line.
This option is used by genhtml, lcov, and geninfo.
exclude = glob_pattern
This option is equivalent to the --exclude option to geninfo, lcov, and genhtml. See the lcov man page for details.;
This option can be used multiple times in the lcovrc file to specify multiple patterns to exclude. The patterns specified in the lcovrc file are appended to the list specified on the command line.
This option is used by genhtml, lcov, and geninfo.
include = glob_pattern
This option is equivalent to the --include option to geninfo, lcov, and genhtml. See the lcov man page for details.;
This option can be used multiple times in the lcovrc file to specify multiple patterns to include. The patterns specified in the lcovrc file are appended to the list specified on the command line.
This option is used by genhtml, lcov, and geninfo.
substitute = regexp
This option is equivalent to the --substitute option to geninfo, lcov, and genhtml. See the lcov man page for details.;
This option can be used multiple times in the lcovrc file to specify multiple substitution patterns. The patterns specified in the lcovrc file are appended to the list specified on the command line.
This option is used by genhtml, lcov, and geninfo.
omit_lines = regexp
This option is equivalent to the --omit-lines option to geninfo, lcov, and genhtml. See the genhtml man page for details.
This option can be used multiple times in the lcovrc file to specify multiple patterns to exclude. The patterns specified in the lcovrc file are appended to the list specified on the command line.
This option is used by genhtml, lcov, and geninfo.
erase_functions = regexp
This option is equivalent to the --erase-functions option to geninfo, lcov, and genhtml. See the genhtml man page for details.
This option can be used multiple times in the lcovrc file to specify multiple patterns to exclude. The patterns specified in the lcovrc file are appended to the list specified on the command line.
This option is used by genhtml, lcov, and geninfo.
lcov_json_module = module|auto
Default is 'auto'.
split_char = char
Default is ',' (comma - no quotes).
scope_regexp = regexp
case_insensitive = [0|1]
Note that mixed-case or lower-case pathnames may be passed to your --version-script and --annotate-script callbacks when case-insensitive matching is used. Your callbacks must handle potential differences in case.
Default is '0': case sensitive matching.
| LCOV 2.0 | 2025-04-03 |