IAP GITLAB

Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • AirShowerPhysics/corsika
  • rulrich/corsika
  • AAAlvesJr/corsika
  • Andre/corsika
  • arrabito/corsika
  • Nikos/corsika
  • olheiser73/corsika
  • AirShowerPhysics/papers/corsika
  • pranav/corsika
9 results
Show changes
Showing
with 0 additions and 3739 deletions
To get an example of how the LCOV generated HTML output looks like,
type 'make output' and point a web browser to the resulting file
output/index.html
test_noargs
Example program is called without arguments so that default range
[0..9] is used.
test_2_to_2000
Example program is called with "2" and "2000" as arguments.
test_overflow
Example program is called with "0" and "100000" as arguments. The
resulting sum is too large to be stored as an int variable.
/*
* example.c
*
* Calculate the sum of a given range of integer numbers. The range is
* specified by providing two integer numbers as command line argument.
* If no arguments are specified, assume the predefined range [0..9].
* Abort with an error message if the resulting number is too big to be
* stored as int variable.
*
* This program example is similar to the one found in the GCOV documentation.
* It is used to demonstrate the HTML output generated by LCOV.
*
* The program is split into 3 modules to better demonstrate the 'directory
* overview' function. There are also a lot of bloated comments inserted to
* artificially increase the source code size so that the 'source code
* overview' function makes at least a minimum of sense.
*
*/
#include <stdio.h>
#include <stdlib.h>
#include "iterate.h"
#include "gauss.h"
static int start = 0;
static int end = 9;
int main (int argc, char* argv[])
{
int total1, total2;
/* Accept a pair of numbers as command line arguments. */
if (argc == 3)
{
start = atoi(argv[1]);
end = atoi(argv[2]);
}
/* Use both methods to calculate the result. */
total1 = iterate_get_sum (start, end);
total2 = gauss_get_sum (start, end);
/* Make sure both results are the same. */
if (total1 != total2)
{
printf ("Failure (%d != %d)!\n", total1, total2);
}
else
{
printf ("Success, sum[%d..%d] = %d\n", start, end, total1);
}
return 0;
}
#ifndef GAUSS_H
#define GAUSS_H GAUSS_h
extern int gauss_get_sum (int min, int max);
#endif /* GAUSS_H */
#ifndef ITERATE_H
#define ITERATE_H ITERATE_H
extern int iterate_get_sum (int min, int max);
#endif /* ITERATE_H */
/*
* methods/gauss.c
*
* Calculate the sum of a given range of integer numbers.
*
* Somewhat of a more subtle way of calculation - and it even has a story
* behind it:
*
* Supposedly during math classes in elementary school, the teacher of
* young mathematician Gauss gave the class an assignment to calculate the
* sum of all natural numbers between 1 and 100, hoping that this task would
* keep the kids occupied for some time. The story goes that Gauss had the
* result ready after only a few minutes. What he had written on his black
* board was something like this:
*
* 1 + 100 = 101
* 2 + 99 = 101
* 3 + 98 = 101
* .
* .
* 100 + 1 = 101
*
* s = (1/2) * 100 * 101 = 5050
*
* A more general form of this formula would be
*
* s = (1/2) * (max + min) * (max - min + 1)
*
* which is used in the piece of code below to implement the requested
* function in constant time, i.e. without dependencies on the size of the
* input parameters.
*
*/
#include "gauss.h"
int gauss_get_sum (int min, int max)
{
/* This algorithm doesn't work well with invalid range specifications
so we're intercepting them here. */
if (max < min)
{
return 0;
}
return (int) ((max + min) * (double) (max - min + 1) / 2);
}
/*
* methods/iterate.c
*
* Calculate the sum of a given range of integer numbers.
*
* This particular method of implementation works by way of brute force,
* i.e. it iterates over the entire range while adding the numbers to finally
* get the total sum. As a positive side effect, we're able to easily detect
* overflows, i.e. situations in which the sum would exceed the capacity
* of an integer variable.
*
*/
#include <stdio.h>
#include <stdlib.h>
#include "iterate.h"
int iterate_get_sum (int min, int max)
{
int i, total;
total = 0;
/* This is where we loop over each number in the range, including
both the minimum and the maximum number. */
for (i = min; i <= max; i++)
{
/* We can detect an overflow by checking whether the new
sum would become negative. */
if (total + i < total)
{
printf ("Error: sum too large!\n");
exit (1);
}
/* Everything seems to fit into an int, so continue adding. */
total += i;
}
return total;
}
#
# /etc/lcovrc - system-wide defaults for LCOV
#
# To change settings for a single user, place a customized copy of this file
# at location ~/.lcovrc
#
# Specify an external style sheet file (same as --css-file option of genhtml)
#genhtml_css_file = gcov.css
# Specify coverage rate limits (in %) for classifying file entries
# HI: hi_limit <= rate <= 100 graph color: green
# MED: med_limit <= rate < hi_limit graph color: orange
# LO: 0 <= rate < med_limit graph color: red
genhtml_hi_limit = 90
genhtml_med_limit = 75
# 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 overview image (used by --frames option of genhtml)
genhtml_overview_width = 80
# Resolution of overview navigation: this number specifies the maximum
# difference in lines between the position a user selected from the overview
# and the position the source code window is scrolled to (used by --frames
# option of genhtml)
genhtml_nav_resolution = 4
# 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 in lines (used by
# --frames option of genhtml)
genhtml_nav_offset = 10
# Do not remove unused test descriptions if non-zero (same as
# --keep-descriptions option of genhtml)
genhtml_keep_descriptions = 0
# Do not remove prefix from directory names if non-zero (same as --no-prefix
# option of genhtml)
genhtml_no_prefix = 0
# Do not create source code view if non-zero (same as --no-source option of
# genhtml)
genhtml_no_source = 0
# Replace tabs with number of spaces in source view (same as --num-spaces
# option of genhtml)
genhtml_num_spaces = 8
# Highlight lines with converted-only data if non-zero (same as --highlight
# option of genhtml)
genhtml_highlight = 0
# Include color legend in HTML output if non-zero (same as --legend option of
# genhtml)
genhtml_legend = 0
# Use FILE as HTML prolog for generated pages (same as --html-prolog option of
# genhtml)
#genhtml_html_prolog = FILE
# Use FILE as HTML epilog for generated pages (same as --html-epilog option of
# genhtml)
#genhtml_html_epilog = FILE
# Use custom filename extension for pages (same as --html-extension option of
# genhtml)
#genhtml_html_extension = html
# Compress all generated html files with gzip.
#genhtml_html_gzip = 1
# Include sorted overview pages (can be disabled by the --no-sort option of
# genhtml)
genhtml_sort = 1
# Include function coverage data display (can be disabled by the
# --no-func-coverage option of genhtml)
#genhtml_function_coverage = 1
# Include branch coverage data display (can be disabled by the
# --no-branch-coverage option of genhtml)
#genhtml_branch_coverage = 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
# Demangle C++ symbols
#genhtml_demangle_cpp=1
# Location of the gcov tool (same as --gcov-info option of geninfo)
#geninfo_gcov_tool = gcov
# Adjust test names to include operating system information if non-zero
#geninfo_adjust_testname = 0
# Calculate checksum for each source code line if non-zero (same as --checksum
# option of geninfo if non-zero, same as --no-checksum if zero)
#geninfo_checksum = 1
# Specify whether to capture coverage data for external source files (can
# be overridden by the --external and --no-external options of geninfo/lcov)
#geninfo_external = 1
# Enable libtool compatibility mode if non-zero (same as --compat-libtool option
# of geninfo if non-zero, same as --no-compat-libtool if zero)
#geninfo_compat_libtool = 0
# Use gcov's --all-blocks option if non-zero
#geninfo_gcov_all_blocks = 1
# Specify compatiblity 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
# Directory containing gcov kernel files
# lcov_gcov_dir = /proc/gcov
# Location of the insmod tool
lcov_insmod_tool = /sbin/insmod
# Location of the modprobe tool
lcov_modprobe_tool = /sbin/modprobe
# Location of the rmmod tool
lcov_rmmod_tool = /sbin/rmmod
# Location for temporary directories
lcov_tmp_dir = /tmp
# Show full paths during list operation if non-zero (same as --list-full-path
# option of lcov)
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 and processed.
lcov_function_coverage = 1
# Specify if branch coverage data should be collected and processed.
lcov_branch_coverage = 0
.TH gendesc 1 "LCOV 1.14" 2019\-02\-28 "User Manuals"
.SH NAME
gendesc \- Generate a test case description file
.SH SYNOPSIS
.B gendesc
.RB [ \-h | \-\-help ]
.RB [ \-v | \-\-version ]
.RS 8
.br
.RB [ \-o | \-\-output\-filename
.IR filename ]
.br
.I inputfile
.SH DESCRIPTION
Convert plain text test case descriptions into a format as understood by
.BR genhtml .
.I inputfile
needs to observe the following format:
For each test case:
.IP " \-"
one line containing the test case name beginning at the start of the line
.RE
.IP " \-"
one or more lines containing the test case description indented with at
least one whitespace character (tab or space)
.RE
.B Example input file:
test01
.RS
An example test case description.
.br
Description continued
.RE
test42
.RS
Supposedly the answer to most of your questions
.RE
Note: valid test names can consist of letters, decimal digits and the
underscore character ('_').
.SH OPTIONS
.B \-h
.br
.B \-\-help
.RS
Print a short help text, then exit.
.RE
.B \-v
.br
.B \-\-version
.RS
Print version number, then exit.
.RE
.BI "\-o " filename
.br
.BI "\-\-output\-filename " filename
.RS
Write description data to
.IR filename .
By default, output is written to STDOUT.
.RE
.SH AUTHOR
Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>
.SH SEE ALSO
.BR lcov (1),
.BR genhtml (1),
.BR geninfo (1),
.BR genpng (1),
.BR gcov (1)
.TH genhtml 1 "LCOV 1.14" 2019\-02\-28 "User Manuals"
.SH NAME
genhtml \- Generate HTML view from LCOV coverage data files
.SH SYNOPSIS
.B genhtml
.RB [ \-h | \-\-help ]
.RB [ \-v | \-\-version ]
.RS 8
.br
.RB [ \-q | \-\-quiet ]
.RB [ \-s | \-\-show\-details ]
.RB [ \-f | \-\-frames ]
.br
.RB [ \-b | \-\-baseline\-file ]
.IR baseline\-file
.br
.RB [ \-o | \-\-output\-directory
.IR output\-directory ]
.br
.RB [ \-t | \-\-title
.IR title ]
.br
.RB [ \-d | \-\-description\-file
.IR description\-file ]
.br
.RB [ \-k | \-\-keep\-descriptions ]
.RB [ \-c | \-\-css\-file
.IR css\-file ]
.br
.RB [ \-p | \-\-prefix
.IR prefix ]
.RB [ \-\-no\-prefix ]
.br
.RB [ \-\-no\-source ]
.RB [ \-\-num\-spaces
.IR num ]
.RB [ \-\-highlight ]
.br
.RB [ \-\-legend ]
.RB [ \-\-html\-prolog
.IR prolog\-file ]
.br
.RB [ \-\-html\-epilog
.IR epilog\-file ]
.RB [ \-\-html\-extension
.IR extension ]
.br
.RB [ \-\-html\-gzip ]
.RB [ \-\-sort ]
.RB [ \-\-no\-sort ]
.br
.RB [ \-\-function\-coverage ]
.RB [ \-\-no\-function\-coverage ]
.br
.RB [ \-\-branch\-coverage ]
.RB [ \-\-no\-branch\-coverage ]
.br
.RB [ \-\-demangle\-cpp ]
.RB [ \-\-ignore\-errors
.IR errors ]
.br
.RB [ \-\-config\-file
.IR config\-file ]
.RB [ \-\-rc
.IR keyword = value ]
.br
.RB [ \-\-precision
.RB [ \-\-missed ]
.br
.IR tracefile(s)
.RE
.SH DESCRIPTION
Create an HTML view of coverage data found in
.IR tracefile .
Note that
.I tracefile
may also be a list of filenames.
HTML output files are created in the current working directory unless the
\-\-output\-directory option is used. If
.I tracefile
ends with ".gz", it is assumed to be GZIP\-compressed and the gunzip tool
will be used to decompress it transparently.
Note that all source code files have to be present and readable at the
exact file system location they were compiled.
Use option
.I \--css\-file
to modify layout and colors of the generated HTML output. Files are
marked in different colors depending on the associated coverage rate. By
default, the coverage limits for low, medium and high coverage are set to
0\-75%, 75\-90% and 90\-100% percent respectively. To change these
values, use configuration file options
.IR genhtml_hi_limit " and " genhtml_med_limit .
Also note that when displaying percentages, 0% and 100% are only printed when
the values are exactly 0% and 100% respectively. Other values which would
conventionally be rounded to 0% or 100% are instead printed as nearest
non-boundary value. This behavior is in accordance with that of the
.BR gcov (1)
tool.
.SH OPTIONS
.B \-h
.br
.B \-\-help
.RS
Print a short help text, then exit.
.RE
.B \-v
.br
.B \-\-version
.RS
Print version number, then exit.
.RE
.B \-q
.br
.B \-\-quiet
.RS
Do not print progress messages.
Suppresses all informational progress output. When this switch is enabled,
only error or warning messages are printed.
.RE
.B \-f
.br
.B \-\-frames
.RS
Use HTML frames for source code view.
If enabled, a frameset is created for each source code file, providing
an overview of the source code as a "clickable" image. Note that this
option will slow down output creation noticeably because each source
code character has to be inspected once. Note also that the GD.pm Perl
module has to be installed for this option to work (it may be obtained
from http://www.cpan.org).
.RE
.B \-s
.br
.B \-\-show\-details
.RS
Generate detailed directory view.
When this option is enabled,
.B genhtml
generates two versions of each
file view. One containing the standard information plus a link to a
"detailed" version. The latter additionally contains information about
which test case covered how many lines of each source file.
.RE
.BI "\-b " baseline\-file
.br
.BI "\-\-baseline\-file " baseline\-file
.RS
Use data in
.I baseline\-file
as coverage baseline.
The tracefile specified by
.I baseline\-file
is read and all counts found in the original
.I tracefile
are decremented by the corresponding counts in
.I baseline\-file
before creating any output.
Note that when a count for a particular line in
.I baseline\-file
is greater than the count in the
.IR tracefile ,
the result is zero.
.RE
.BI "\-o " output\-directory
.br
.BI "\-\-output\-directory " output\-directory
.RS
Create files in
.I output\-directory.
Use this option to tell
.B genhtml
to write the resulting files to a directory other than
the current one. If
.I output\-directory
does not exist, it will be created.
It is advisable to use this option since depending on the
project size, a lot of files and subdirectories may be created.
.RE
.BI "\-t " title
.br
.BI "\-\-title " title
.RS
Display
.I title
in header of all pages.
.I title
is written to the header portion of each generated HTML page to
identify the context in which a particular output
was created. By default this is the name of the tracefile.
.RE
.BI "\-d " description\-file
.br
.BI "\-\-description\-file " description\-file
.RS
Read test case descriptions from
.IR description\-file .
All test case descriptions found in
.I description\-file
and referenced in the input data file are read and written to an extra page
which is then incorporated into the HTML output.
The file format of
.IR "description\-file " is:
for each test case:
.RS
TN:<testname>
.br
TD:<test description>
.RE
Valid test case names can consist of letters, numbers and the underscore
character ('_').
.RE
.B \-k
.br
.B \-\-keep\-descriptions
.RS
Do not remove unused test descriptions.
Keep descriptions found in the description file even if the coverage data
indicates that the associated test case did not cover any lines of code.
This option can also be configured permanently using the configuration file
option
.IR genhtml_keep_descriptions .
.RE
.BI "\-c " css\-file
.br
.BI "\-\-css\-file " css\-file
.RS
Use external style sheet file
.IR css\-file .
Using this option, an extra .css file may be specified which will replace
the default one. This may be helpful if the default colors make your eyes want
to jump out of their sockets :)
This option can also be configured permanently using the configuration file
option
.IR genhtml_css_file .
.RE
.BI "\-p " prefix
.br
.BI "\-\-prefix " prefix
.RS
Remove
.I prefix
from all directory names.
Because lists containing long filenames are difficult to read, there is a
mechanism implemented that will automatically try to shorten all directory
names on the overview page beginning with a common prefix. By default,
this is done using an algorithm that tries to find the prefix which, when
applied, will minimize the resulting sum of characters of all directory
names.
Use this option to specify the prefix to be removed by yourself.
.RE
.B \-\-no\-prefix
.RS
Do not remove prefix from directory names.
This switch will completely disable the prefix mechanism described in the
previous section.
This option can also be configured permanently using the configuration file
option
.IR genhtml_no_prefix .
.RE
.B \-\-no\-source
.RS
Do not create source code view.
Use this switch if you don't want to get a source code view for each file.
This option can also be configured permanently using the configuration file
option
.IR genhtml_no_source .
.RE
.BI "\-\-num\-spaces " spaces
.RS
Replace tabs in source view with
.I num
spaces.
Default value is 8.
This option can also be configured permanently using the configuration file
option
.IR genhtml_num_spaces .
.RE
.B \-\-highlight
.RS
Highlight lines with converted\-only coverage data.
Use this option in conjunction with the \-\-diff option of
.B lcov
to highlight those lines which were only covered in data sets which were
converted from previous source code versions.
This option can also be configured permanently using the configuration file
option
.IR genhtml_highlight .
.RE
.B \-\-legend
.RS
Include color legend in HTML output.
Use this option to include a legend explaining the meaning of color coding
in the resulting HTML output.
This option can also be configured permanently using the configuration file
option
.IR genhtml_legend .
.RE
.BI "\-\-html\-prolog " prolog\-file
.RS
Read customized HTML prolog from
.IR prolog\-file .
Use this option to replace the default HTML prolog (the initial part of the
HTML source code leading up to and including the <body> tag) with the contents
of
.IR prolog\-file .
Within the prolog text, the following words will be replaced when a page is generated:
.B "@pagetitle@"
.br
The title of the page.
.B "@basedir@"
.br
A relative path leading to the base directory (e.g. for locating css\-files).
This option can also be configured permanently using the configuration file
option
.IR genhtml_html_prolog .
.RE
.BI "\-\-html\-epilog " epilog\-file
.RS
Read customized HTML epilog from
.IR epilog\-file .
Use this option to replace the default HTML epilog (the final part of the HTML
source including </body>) with the contents of
.IR epilog\-file .
Within the epilog text, the following words will be replaced when a page is generated:
.B "@basedir@"
.br
A relative path leading to the base directory (e.g. for locating css\-files).
This option can also be configured permanently using the configuration file
option
.IR genhtml_html_epilog .
.RE
.BI "\-\-html\-extension " extension
.RS
Use customized filename extension for generated HTML pages.
This option is useful in situations where different filename extensions
are required to render the resulting pages correctly (e.g. php). Note that
a '.' will be inserted between the filename and the extension specified by
this option.
This option can also be configured permanently using the configuration file
option
.IR genhtml_html_extension .
.RE
.B \-\-html\-gzip
.RS
Compress all generated html files with gzip and add a .htaccess file specifying
gzip\-encoding in the root output directory.
Use this option if you want to save space on your webserver. Requires a
webserver with .htaccess support and a browser with support for gzip
compressed html.
This option can also be configured permanently using the configuration file
option
.IR genhtml_html_gzip .
.RE
.B \-\-sort
.br
.B \-\-no\-sort
.RS
Specify whether to include sorted views of file and directory overviews.
Use \-\-sort to include sorted views or \-\-no\-sort to not include them.
Sorted views are
.B enabled
by default.
When sorted views are enabled, each overview page will contain links to
views of that page sorted by coverage rate.
This option can also be configured permanently using the configuration file
option
.IR genhtml_sort .
.RE
.B \-\-function\-coverage
.br
.B \-\-no\-function\-coverage
.RS
Specify whether to display function coverage summaries in HTML output.
Use \-\-function\-coverage to enable function coverage summaries or
\-\-no\-function\-coverage to disable it. Function coverage summaries are
.B enabled
by default
When function coverage summaries are enabled, each overview page will contain
the number of functions found and hit per file or directory, together with
the resulting coverage rate. In addition, each source code view will contain
a link to a page which lists all functions found in that file plus the
respective call count for those functions.
This option can also be configured permanently using the configuration file
option
.IR genhtml_function_coverage .
.RE
.B \-\-branch\-coverage
.br
.B \-\-no\-branch\-coverage
.RS
Specify whether to display branch coverage data in HTML output.
Use \-\-branch\-coverage to enable branch coverage display or
\-\-no\-branch\-coverage to disable it. Branch coverage data display is
.B enabled
by default
When branch coverage display is enabled, each overview page will contain
the number of branches found and hit per file or directory, together with
the resulting coverage rate. In addition, each source code view will contain
an extra column which lists all branches of a line with indications of
whether the branch was taken or not. Branches are shown in the following format:
' + ': Branch was taken at least once
.br
' - ': Branch was not taken
.br
' # ': The basic block containing the branch was never executed
.br
Note that it might not always be possible to relate branches to the
corresponding source code statements: during compilation, GCC might shuffle
branches around or eliminate some of them to generate better code.
This option can also be configured permanently using the configuration file
option
.IR genhtml_branch_coverage .
.RE
.B \-\-demangle\-cpp
.RS
Specify whether to demangle C++ function names.
Use this option if you want to convert C++ internal function names to
human readable format for display on the HTML function overview page.
This option requires that the c++filt tool is installed (see
.BR c++filt (1)).
.RE
.B \-\-ignore\-errors
.I errors
.br
.RS
Specify a list of errors after which to continue processing.
Use this option to specify a list of one or more classes of errors after which
geninfo should continue processing instead of aborting.
.I errors
can be a comma\-separated list of the following keywords:
.B source:
the source code file for a data set could not be found.
.RE
.B \-\-config\-file
.I config\-file
.br
.RS
Specify a configuration file to use.
When this option is specified, neither the system\-wide configuration file
/etc/lcovrc, nor the per\-user configuration file ~/.lcovrc is read.
This option may be useful when there is a need to run several
instances of
.B genhtml
with different configuration file options in parallel.
.RE
.B \-\-rc
.IR keyword = value
.br
.RS
Override a configuration directive.
Use this option to specify a
.IR keyword = value
statement which overrides the corresponding configuration statement in
the lcovrc configuration file. You can specify this option more than once
to override multiple configuration statements.
See
.BR lcovrc (5)
for a list of available keywords and their meaning.
.RE
.BI "\-\-precision " num
.RS
Show coverage rates with
.I num
number of digits after the decimal-point.
Default value is 1.
This option can also be configured permanently using the configuration file
option
.IR genhtml_precision .
.RE
.B \-\-missed
.RS
Show counts of missed lines, functions, or branches
Use this option to change overview pages to show the count of lines, functions,
or branches that were not hit. These counts are represented by negative numbers.
When specified together with \-\-sort, file and directory views will be sorted
by missed counts.
This option can also be configured permanently using the configuration file
option
.IR genhtml_missed .
.RE
.SH FILES
.I /etc/lcovrc
.RS
The system\-wide configuration file.
.RE
.I ~/.lcovrc
.RS
The per\-user configuration file.
.RE
.SH AUTHOR
Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>
.SH SEE ALSO
.BR lcov (1),
.BR lcovrc (5),
.BR geninfo (1),
.BR genpng (1),
.BR gendesc (1),
.BR gcov (1)
.TH geninfo 1 "LCOV 1.14" 2019\-02\-28 "User Manuals"
.SH NAME
geninfo \- Generate tracefiles from .da files
.SH SYNOPSIS
.B geninfo
.RB [ \-h | \-\-help ]
.RB [ \-v | \-\-version ]
.RB [ \-q | \-\-quiet ]
.br
.RS 8
.RB [ \-i | \-\-initial ]
.RB [ \-t | \-\-test\-name
.IR test\-name ]
.br
.RB [ \-o | \-\-output\-filename
.IR filename ]
.RB [ \-f | \-\-follow ]
.br
.RB [ \-b | \-\-base\-directory
.IR directory ]
.br
.RB [ \-\-checksum ]
.RB [ \-\-no\-checksum ]
.br
.RB [ \-\-compat\-libtool ]
.RB [ \-\-no\-compat\-libtool ]
.br
.RB [ \-\-gcov\-tool
.IR tool ]
.RB [ \-\-ignore\-errors
.IR errors ]
.br
.RB [ \-\-no\-recursion ]
.I directory
.RB [ \-\-external ]
.RB [ \-\-no\-external ]
.br
.RB [ \-\-config\-file
.IR config\-file ]
.RB [ \-\-no\-markers ]
.br
.RB [ \-\-derive\-func\-data ]
.RB [ \-\-compat
.IR mode =on|off|auto]
.br
.RB [ \-\-rc
.IR keyword = value ]
.br
.RB [ \-\-include
.IR pattern ]
.RB [ \-\-exclude
.IR pattern ]
.RE
.SH DESCRIPTION
.B geninfo
converts all GCOV coverage data files found in
.I directory
into tracefiles, which the
.B genhtml
tool can convert to HTML output.
Unless the \-\-output\-filename option is specified,
.B geninfo
writes its
output to one file per .da file, the name of which is generated by simply
appending ".info" to the respective .da file name.
Note that the current user needs write access to both
.I directory
as well as to the original source code location. This is necessary because
some temporary files have to be created there during the conversion process.
Note also that
.B geninfo
is called from within
.BR lcov ,
so that there is usually no need to call it directly.
.B Exclusion markers
To exclude specific lines of code from a tracefile, you can add exclusion
markers to the source code. Additionally you can exclude specific branches from
branch coverage without excluding the involved lines from line and function
coverage. Exclusion markers are keywords which can for example be added in the
form of a comment.
See
.BR lcovrc (5)
how to override some of them.
The following markers are recognized by geninfo:
LCOV_EXCL_LINE
.RS
Lines containing this marker will be excluded.
.br
.RE
LCOV_EXCL_START
.RS
Marks the beginning of an excluded section. The current line is part of this
section.
.br
.RE
LCOV_EXCL_STOP
.RS
Marks the end of an excluded section. The current line not part of this
section.
.RE
.br
LCOV_EXCL_BR_LINE
.RS
Lines containing this marker will be excluded from branch coverage.
.br
.RE
LCOV_EXCL_BR_START
.RS
Marks the beginning of a section which is excluded from branch coverage. The
current line is part of this section.
.br
.RE
LCOV_EXCL_BR_STOP
.RS
Marks the end of a section which is excluded from branch coverage. The current
line not part of this section.
.RE
.br
.SH OPTIONS
.B \-b
.I directory
.br
.B \-\-base\-directory
.I directory
.br
.RS
.RI "Use " directory
as base directory for relative paths.
Use this option to specify the base directory of a build\-environment
when geninfo produces error messages like:
.RS
ERROR: could not read source file /home/user/project/subdir1/subdir2/subdir1/subdir2/file.c
.RE
In this example, use /home/user/project as base directory.
This option is required when using geninfo on projects built with libtool or
similar build environments that work with a base directory, 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.
Note that this option will not work in environments where multiple base
directories are used. In that case use configuration file setting
.B geninfo_auto_base=1
(see
.BR lcovrc (5)).
.RE
.B \-\-checksum
.br
.B \-\-no\-checksum
.br
.RS
Specify whether to generate checksum data when writing tracefiles.
Use \-\-checksum to enable checksum generation or \-\-no\-checksum to
disable it. Checksum generation is
.B disabled
by default.
When checksum generation is enabled, a checksum will be generated for each
source code line and stored along with the coverage data. This checksum will
be used to prevent attempts to combine coverage data from different source
code versions.
If you don't work with different source code versions, disable this option
to speed up coverage data processing and to reduce the size of tracefiles.
.RE
.B \-\-compat
.IR mode = value [, mode = value ,...]
.br
.RS
Set compatibility mode.
Use \-\-compat to specify that geninfo should enable one or more compatibility
modes when capturing coverage data. You can provide a comma-separated list
of mode=value pairs to specify the values for multiple modes.
Valid
.I values
are:
.B on
.RS
Enable compatibility mode.
.RE
.B off
.RS
Disable compatibility mode.
.RE
.B auto
.RS
Apply auto-detection to determine if compatibility mode is required. Note that
auto-detection is not available for all compatibility modes.
.RE
If no value is specified, 'on' is assumed as default value.
Valid
.I modes
are:
.B libtool
.RS
Enable this mode if you are capturing coverage data for a project that
was built using the libtool mechanism. See also
\-\-compat\-libtool.
The default value for this setting is 'on'.
.RE
.B hammer
.RS
Enable this mode if you are capturing coverage data for a project that
was built using a version of GCC 3.3 that contains a modification
(hammer patch) of later GCC versions. You can identify a modified GCC 3.3
by checking the build directory of your project for files ending in the
extension '.bbg'. Unmodified versions of GCC 3.3 name these files '.bb'.
The default value for this setting is 'auto'.
.RE
.B split_crc
.RS
Enable this mode if you are capturing coverage data for a project that
was built using a version of GCC 4.6 that contains a modification
(split function checksums) of later GCC versions. Typical error messages
when running geninfo on coverage data produced by such GCC versions are
\'out of memory' and 'reached unexpected end of file'.
The default value for this setting is 'auto'
.RE
.RE
.B \-\-compat\-libtool
.br
.B \-\-no\-compat\-libtool
.br
.RS
Specify whether to enable libtool compatibility mode.
Use \-\-compat\-libtool to enable libtool compatibility mode or \-\-no\-compat\-libtool
to disable it. The libtool compatibility mode is
.B enabled
by default.
When libtool compatibility mode is enabled, geninfo will assume that the source
code relating to a .da file located in a directory named ".libs" can be
found in its parent directory.
If you have directories named ".libs" in your build environment but don't use
libtool, disable this option to prevent problems when capturing coverage data.
.RE
.B \-\-config\-file
.I config\-file
.br
.RS
Specify a configuration file to use.
When this option is specified, neither the system\-wide configuration file
/etc/lcovrc, nor the per\-user configuration file ~/.lcovrc is read.
This option may be useful when there is a need to run several
instances of
.B geninfo
with different configuration file options in parallel.
.RE
.B \-\-derive\-func\-data
.br
.RS
Calculate function coverage data from line coverage data.
Use this option to collect function coverage data, even if the version of the
gcov tool installed on the test system does not provide this data. lcov will
instead derive function coverage data from line coverage data and
information about which lines belong to a function.
.RE
.B \-\-exclude
.I pattern
.br
.RS
Exclude source files matching
.IR pattern .
Use this switch if you want to exclude coverage data for a particular set
of source files matching any of the given patterns. Multiple patterns can be
specified by using multiple
.B --exclude
command line switches. The
.I patterns
will be interpreted as shell wildcard patterns (note that they may need to be
escaped accordingly to prevent the shell from expanding them first).
Can be combined with the
.B --include
command line switch. If a given file matches both the include pattern and the
exclude pattern, the exclude pattern will take precedence.
.RE
.B \-\-external
.br
.B \-\-no\-external
.br
.RS
Specify whether to capture coverage data for external source files.
External source files are files which are not located in one of the directories
specified by \-\-directory or \-\-base\-directory. Use \-\-external to include
external source files while capturing coverage data or \-\-no\-external to
ignore this data.
Data for external source files is
.B included
by default.
.RE
.B \-f
.br
.B \-\-follow
.RS
Follow links when searching .da files.
.RE
.B \-\-gcov\-tool
.I tool
.br
.RS
Specify the location of the gcov tool.
.RE
.B \-h
.br
.B \-\-help
.RS
Print a short help text, then exit.
.RE
.B \-\-include
.I pattern
.br
.RS
Include source files matching
.IR pattern .
Use this switch if you want to include coverage data for only a particular set
of source files matching any of the given patterns. Multiple patterns can be
specified by using multiple
.B --include
command line switches. The
.I patterns
will be interpreted as shell wildcard patterns (note that they may need to be
escaped accordingly to prevent the shell from expanding them first).
.RE
.B \-\-ignore\-errors
.I errors
.br
.RS
Specify a list of errors after which to continue processing.
Use this option to specify a list of one or more classes of errors after which
geninfo should continue processing instead of aborting.
.I errors
can be a comma\-separated list of the following keywords:
.B gcov:
the gcov tool returned with a non\-zero return code.
.B source:
the source code file for a data set could not be found.
.RE
.B \-i
.br
.B \-\-initial
.RS
Capture initial zero coverage data.
Run geninfo with this option on the directories containing .bb, .bbg or .gcno
files before running any test case. The result is a "baseline" coverage data
file that contains zero coverage for every instrumented line and function.
Combine this data file (using lcov \-a) with coverage data files captured
after a test run to ensure that the percentage of total lines covered is
correct even when not all object code files were loaded during the test.
Note: currently, the \-\-initial option does not generate branch coverage
information.
.RE
.B \-\-no\-markers
.br
.RS
Use this option if you want to get coverage data without regard to exclusion
markers in the source code file.
.RE
.B \-\-no\-recursion
.br
.RS
Use this option if you want to get coverage data for the specified directory
only without processing subdirectories.
.RE
.BI "\-o " output\-filename
.br
.BI "\-\-output\-filename " output\-filename
.RS
Write all data to
.IR output\-filename .
If you want to have all data written to a single file (for easier
handling), use this option to specify the respective filename. By default,
one tracefile will be created for each processed .da file.
.RE
.B \-q
.br
.B \-\-quiet
.RS
Do not print progress messages.
Suppresses all informational progress output. When this switch is enabled,
only error or warning messages are printed.
.RE
.B \-\-rc
.IR keyword = value
.br
.RS
Override a configuration directive.
Use this option to specify a
.IR keyword = value
statement which overrides the corresponding configuration statement in
the lcovrc configuration file. You can specify this option more than once
to override multiple configuration statements.
See
.BR lcovrc (5)
for a list of available keywords and their meaning.
.RE
.BI "\-t " testname
.br
.BI "\-\-test\-name " testname
.RS
Use test case name
.I testname
for resulting data. Valid test case names can consist of letters, decimal
digits and the underscore character ('_').
This proves useful when data from several test cases is merged (i.e. by
simply concatenating the respective tracefiles) in which case a test
name can be used to differentiate between data from each test case.
.RE
.B \-v
.br
.B \-\-version
.RS
Print version number, then exit.
.RE
.SH FILES
.I /etc/lcovrc
.RS
The system\-wide configuration file.
.RE
.I ~/.lcovrc
.RS
The per\-user configuration file.
.RE
Following is a quick description of the tracefile format as used by
.BR genhtml ", " geninfo " and " lcov .
A tracefile is made up of several human\-readable lines of text,
divided into sections. If available, a tracefile begins with the
.I testname
which is stored in the following format:
TN:<test name>
For each source file referenced in the .da file, there is a section containing
filename and coverage data:
SF:<absolute path to the source file>
Following is a list of line numbers for each function name found in the
source file:
FN:<line number of function start>,<function name>
Next, there is a list of execution counts for each instrumented function:
FNDA:<execution count>,<function name>
This list is followed by two lines containing the number of functions found
and hit:
FNF:<number of functions found>
FNH:<number of function hit>
Branch coverage information is stored which one line per branch:
BRDA:<line number>,<block number>,<branch number>,<taken>
Block number and branch number are gcc internal IDs for the branch. Taken is
either '-' if the basic block containing the branch was never executed or
a number indicating how often that branch was taken.
Branch coverage summaries are stored in two lines:
BRF:<number of branches found>
BRH:<number of branches hit>
Then there is a list of execution counts for each instrumented line
(i.e. a line which resulted in executable code):
DA:<line number>,<execution count>[,<checksum>]
Note that there may be an optional checksum present for each instrumented
line. The current
.B geninfo
implementation uses an MD5 hash as checksumming algorithm.
At the end of a section, there is a summary about how many lines
were found and how many were actually instrumented:
LH:<number of lines with a non\-zero execution count>
LF:<number of instrumented lines>
Each sections ends with:
end_of_record
In addition to the main source code file there are sections for all
#included files which also contain executable code.
Note that the absolute path of a source file is generated by interpreting
the contents of the respective .bb file (see
.BR "gcov " (1)
for more information on this file type). Relative filenames are prefixed
with the directory in which the .bb file is found.
Note also that symbolic links to the .bb file will be resolved so that the
actual file path is used instead of the path to a link. This approach is
necessary for the mechanism to work with the /proc/gcov files.
.SH AUTHOR
Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>
.SH SEE ALSO
.BR lcov (1),
.BR lcovrc (5),
.BR genhtml (1),
.BR genpng (1),
.BR gendesc (1),
.BR gcov (1)
.TH genpng 1 "LCOV 1.14" 2019\-02\-28 "User Manuals"
.SH NAME
genpng \- Generate an overview image from a source file
.SH SYNOPSIS
.B genpng
.RB [ \-h | \-\-help ]
.RB [ \-v | \-\-version ]
.RS 7
.br
.RB [ \-t | \-\-tab\-size
.IR tabsize ]
.RB [ \-w | \-\-width
.IR width ]
.br
.RB [ \-o | \-\-output\-filename
.IR output\-filename ]
.br
.IR source\-file
.SH DESCRIPTION
.B genpng
creates an overview image for a given source code file of either
plain text or .gcov file format.
Note that the
.I GD.pm
Perl module has to be installed for this script to work
(it may be obtained from
.IR http://www.cpan.org ).
Note also that
.B genpng
is called from within
.B genhtml
so that there is usually no need to call it directly.
.SH OPTIONS
.B \-h
.br
.B \-\-help
.RS
Print a short help text, then exit.
.RE
.B \-v
.br
.B \-\-version
.RS
Print version number, then exit.
.RE
.BI "\-t " tab\-size
.br
.BI "\-\-tab\-size " tab\-size
.RS
Use
.I tab\-size
spaces in place of tab.
All occurrences of tabulator signs in the source code file will be replaced
by the number of spaces defined by
.I tab\-size
(default is 4).
.RE
.BI "\-w " width
.br
.BI "\-\-width " width
.RS
Set width of output image to
.I width
pixel.
The resulting image will be exactly
.I width
pixel wide (default is 80).
Note that source code lines which are longer than
.I width
will be truncated.
.RE
.BI "\-o " filename
.br
.BI "\-\-output\-filename " filename
.RS
Write image to
.IR filename .
Specify a name for the resulting image file (default is
.IR source\-file .png).
.RE
.SH AUTHOR
Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>
.SH SEE ALSO
.BR lcov (1),
.BR genhtml (1),
.BR geninfo (1),
.BR gendesc (1),
.BR gcov (1)
.TH lcov 1 "LCOV 1.14" 2019\-02\-28 "User Manuals"
.SH NAME
lcov \- a graphical GCOV front\-end
.SH SYNOPSIS
.B lcov
.BR \-c | \-\-capture
.RS 5
.br
.RB [ \-d | \-\-directory
.IR directory ]
.RB [ \-k | \-\-kernel\-directory
.IR directory ]
.br
.RB [ \-o | \-\-output\-file
.IR tracefile ]
.RB [ \-t | \-\-test\-name
.IR testname ]
.br
.RB [ \-b | \-\-base\-directory
.IR directory ]
.RB [ \-i | \-\-initial ]
.RB [ \-\-gcov\-tool
.IR tool ]
.br
.RB [ \-\-checksum ]
.RB [ \-\-no\-checksum ]
.RB [ \-\-no\-recursion ]
.RB [ \-f | \-\-follow ]
.br
.RB [ \-\-compat\-libtool ]
.RB [ \-\-no\-compat\-libtool ]
.RB [ \-\-ignore\-errors
.IR errors ]
.br
.RB [ \-\-to\-package
.IR package ]
.RB [ \-\-from\-package
.IR package ]
.RB [ \-q | \-\-quiet ]
.br
.RB [ \-\-no\-markers ]
.RB [ \-\-external ]
.RB [ \-\-no\-external ]
.br
.RB [ \-\-config\-file
.IR config\-file ]
.RB [ \-\-rc
.IR keyword = value ]
.br
.RB [ \-\-compat
.IR mode =on|off|auto]
.br
.RB [ \-\-include
.IR pattern ]
.RB [ \-\-exclude
.IR pattern ]
.br
.RE
.B lcov
.BR \-z | \-\-zerocounters
.RS 5
.br
.RB [ \-d | \-\-directory
.IR directory ]
.RB [ \-\-no\-recursion ]
.RB [ \-f | \-\-follow ]
.br
.RB [ \-q | \-\-quiet ]
.br
.RE
.B lcov
.BR \-l | \-\-list
.I tracefile
.RS 5
.br
.RB [ \-q | \-\-quiet ]
.RB [ \-\-list\-full\-path ]
.RB [ \-\-no\-list\-full\-path ]
.br
.RB [ \-\-config\-file
.IR config\-file ]
.RB [ \-\-rc
.IR keyword = value ]
.br
.RE
.B lcov
.BR \-a | \-\-add\-tracefile
.I tracefile
.RS 5
.br
.RB [ \-o | \-\-output\-file
.IR tracefile ]
.RB [ \-\-checksum ]
.RB [ \-\-no\-checksum ]
.br
.RB [ \-q | \-\-quiet ]
.RB [ \-\-config\-file
.IR config\-file ]
.RB [ \-\-rc
.IR keyword = value ]
.br
.RE
.B lcov
.BR \-e | \-\-extract
.I tracefile pattern
.RS 5
.br
.RB [ \-o | \-\-output\-file
.IR tracefile ]
.RB [ \-\-checksum ]
.RB [ \-\-no\-checksum ]
.br
.RB [ \-q | \-\-quiet ]
.RB [ \-\-config\-file
.IR config\-file ]
.RB [ \-\-rc
.IR keyword = value ]
.br
.RE
.B lcov
.BR \-r | \-\-remove
.I tracefile pattern
.RS 5
.br
.RB [ \-o | \-\-output\-file
.IR tracefile ]
.RB [ \-\-checksum ]
.RB [ \-\-no\-checksum ]
.br
.RB [ \-q | \-\-quiet ]
.RB [ \-\-config\-file
.IR config\-file ]
.RB [ \-\-rc
.IR keyword = value ]
.br
.RE
.B lcov
.BR \-\-diff
.IR "tracefile diff"
.RS 5
.br
.RB [ \-o | \-\-output\-file
.IR tracefile ]
.RB [ \-\-checksum ]
.RB [ \-\-no\-checksum ]
.br
.RB [ \-\-convert\-filenames ]
.RB [ \-\-strip
.IR depth ]
.RB [ \-\-path
.IR path ]
.RB [ \-q | \-\-quiet ]
.br
.RB [ \-\-config\-file
.IR config\-file ]
.RB [ \-\-rc
.IR keyword = value ]
.br
.RE
.B lcov
.BR \-\-summary
.I tracefile
.RS 5
.br
.RB [ \-q | \-\-quiet ]
.br
.RE
.B lcov
.RB [ \-h | \-\-help ]
.RB [ \-v | \-\-version ]
.RS 5
.br
.RE
.SH DESCRIPTION
.B lcov
is a graphical front\-end for GCC's coverage testing tool gcov. It collects
line, function and branch coverage data for multiple source files and creates
HTML pages containing the source code annotated with coverage information.
It also adds overview pages for easy navigation within the file structure.
Use
.B lcov
to collect coverage data and
.B genhtml
to create HTML pages. Coverage data can either be collected from the
currently running Linux kernel or from a user space application. To do this,
you have to complete the following preparation steps:
For Linux kernel coverage:
.RS
Follow the setup instructions for the gcov\-kernel infrastructure:
.I http://ltp.sourceforge.net/coverage/gcov.php
.br
.RE
For user space application coverage:
.RS
Compile the application with GCC using the options
"\-fprofile\-arcs" and "\-ftest\-coverage".
.RE
Please note that this man page refers to the output format of
.B lcov
as ".info file" or "tracefile" and that the output of GCOV
is called ".da file".
Also note that when printing percentages, 0% and 100% are only printed when
the values are exactly 0% and 100% respectively. Other values which would
conventionally be rounded to 0% or 100% are instead printed as nearest
non-boundary value. This behavior is in accordance with that of the
.BR gcov (1)
tool.
.SH OPTIONS
.B \-a
.I tracefile
.br
.B \-\-add\-tracefile
.I tracefile
.br
.RS
Add contents of
.IR tracefile .
Specify several tracefiles using the \-a switch to combine the coverage data
contained in these files by adding up execution counts for matching test and
filename combinations.
The result of the add operation will be written to stdout or the tracefile
specified with \-o.
Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE
.B \-b
.I directory
.br
.B \-\-base\-directory
.I directory
.br
.RS
.RI "Use " directory
as base directory for relative paths.
Use this option to specify the base directory of a build\-environment
when lcov produces error messages like:
.RS
ERROR: could not read source file /home/user/project/subdir1/subdir2/subdir1/subdir2/file.c
.RE
In this example, use /home/user/project as base directory.
This option is required when using lcov on projects built with libtool or
similar build environments that work with a base directory, 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.
Note that this option will not work in environments where multiple base
directories are used. In that case use configuration file setting
.B geninfo_auto_base=1
(see
.BR lcovrc (5)).
.RE
.B \-c
.br
.B \-\-capture
.br
.RS
Capture coverage data.
By default captures the current kernel execution counts and writes the
resulting coverage data to the standard output. Use the \-\-directory
option to capture counts for a user space program.
The result of the capture operation will be written to stdout or the tracefile
specified with \-o.
Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE
.B \-\-checksum
.br
.B \-\-no\-checksum
.br
.RS
Specify whether to generate checksum data when writing tracefiles.
Use \-\-checksum to enable checksum generation or \-\-no\-checksum to
disable it. Checksum generation is
.B disabled
by default.
When checksum generation is enabled, a checksum will be generated for each
source code line and stored along with the coverage data. This checksum will
be used to prevent attempts to combine coverage data from different source
code versions.
If you don't work with different source code versions, disable this option
to speed up coverage data processing and to reduce the size of tracefiles.
.RE
.B \-\-compat
.IR mode = value [, mode = value ,...]
.br
.RS
Set compatibility mode.
Use \-\-compat to specify that lcov should enable one or more compatibility
modes when capturing coverage data. You can provide a comma-separated list
of mode=value pairs to specify the values for multiple modes.
Valid
.I values
are:
.B on
.RS
Enable compatibility mode.
.RE
.B off
.RS
Disable compatibility mode.
.RE
.B auto
.RS
Apply auto-detection to determine if compatibility mode is required. Note that
auto-detection is not available for all compatibility modes.
.RE
If no value is specified, 'on' is assumed as default value.
Valid
.I modes
are:
.B libtool
.RS
Enable this mode if you are capturing coverage data for a project that
was built using the libtool mechanism. See also
\-\-compat\-libtool.
The default value for this setting is 'on'.
.RE
.B hammer
.RS
Enable this mode if you are capturing coverage data for a project that
was built using a version of GCC 3.3 that contains a modification
(hammer patch) of later GCC versions. You can identify a modified GCC 3.3
by checking the build directory of your project for files ending in the
extension '.bbg'. Unmodified versions of GCC 3.3 name these files '.bb'.
The default value for this setting is 'auto'.
.RE
.B split_crc
.RS
Enable this mode if you are capturing coverage data for a project that
was built using a version of GCC 4.6 that contains a modification
(split function checksums) of later GCC versions. Typical error messages
when running lcov on coverage data produced by such GCC versions are
\'out of memory' and 'reached unexpected end of file'.
The default value for this setting is 'auto'
.RE
.RE
.B \-\-compat\-libtool
.br
.B \-\-no\-compat\-libtool
.br
.RS
Specify whether to enable libtool compatibility mode.
Use \-\-compat\-libtool to enable libtool compatibility mode or \-\-no\-compat\-libtool
to disable it. The libtool compatibility mode is
.B enabled
by default.
When libtool compatibility mode is enabled, lcov will assume that the source
code relating to a .da file located in a directory named ".libs" can be
found in its parent directory.
If you have directories named ".libs" in your build environment but don't use
libtool, disable this option to prevent problems when capturing coverage data.
.RE
.B \-\-config\-file
.I config\-file
.br
.RS
Specify a configuration file to use.
When this option is specified, neither the system\-wide configuration file
/etc/lcovrc, nor the per\-user configuration file ~/.lcovrc is read.
This option may be useful when there is a need to run several
instances of
.B lcov
with different configuration file options in parallel.
.RE
.B \-\-convert\-filenames
.br
.RS
Convert filenames when applying diff.
Use this option together with \-\-diff to rename the file names of processed
data sets according to the data provided by the diff.
.RE
.B \-\-diff
.I tracefile
.I difffile
.br
.RS
Convert coverage data in
.I tracefile
using source code diff file
.IR difffile .
Use this option if you want to merge coverage data from different source code
levels of a program, e.g. when you have data taken from an older version
and want to combine it with data from a more current version.
.B lcov
will try to map source code lines between those versions and adjust the coverage
data respectively.
.I difffile
needs to be in unified format, i.e. it has to be created using the "\-u" option
of the
.B diff
tool.
Note that lines which are not present in the old version will not be counted
as instrumented, therefore tracefiles resulting from this operation should
not be interpreted individually but together with other tracefiles taken
from the newer version. Also keep in mind that converted coverage data should
only be used for overview purposes as the process itself introduces a loss
of accuracy.
The result of the diff operation will be written to stdout or the tracefile
specified with \-o.
Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE
.B \-d
.I directory
.br
.B \-\-directory
.I directory
.br
.RS
Use .da files in
.I directory
instead of kernel.
If you want to work on coverage data for a user space program, use this
option to specify the location where the program was compiled (that's
where the counter files ending with .da will be stored).
Note that you may specify this option more than once.
.RE
.B \-\-exclude
.I pattern
.br
.RS
Exclude source files matching
.IR pattern .
Use this switch if you want to exclude coverage data for a particular set
of source files matching any of the given patterns. Multiple patterns can be
specified by using multiple
.B --exclude
command line switches. The
.I patterns
will be interpreted as shell wildcard patterns (note that they may need to be
escaped accordingly to prevent the shell from expanding them first).
Can be combined with the
.B --include
command line switch. If a given file matches both the include pattern and the
exclude pattern, the exclude pattern will take precedence.
.RE
.B \-\-external
.br
.B \-\-no\-external
.br
.RS
Specify whether to capture coverage data for external source files.
External source files are files which are not located in one of the directories
specified by \-\-directory or \-\-base\-directory. Use \-\-external to include
external source files while capturing coverage data or \-\-no\-external to
ignore this data.
Data for external source files is
.B included
by default.
.RE
.B \-e
.I tracefile
.I pattern
.br
.B \-\-extract
.I tracefile
.I pattern
.br
.RS
Extract data from
.IR tracefile .
Use this switch if you want to extract coverage data for only a particular
set of files from a tracefile. Additional command line parameters will be
interpreted as shell wildcard patterns (note that they may need to be
escaped accordingly to prevent the shell from expanding them first).
Every file entry in
.I tracefile
which matches at least one of those patterns will be extracted.
The result of the extract operation will be written to stdout or the tracefile
specified with \-o.
Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE
.B \-f
.br
.B \-\-follow
.br
.RS
Follow links when searching for .da files.
.RE
.B \-\-from\-package
.I package
.br
.RS
Use .da files in
.I package
instead of kernel or directory.
Use this option if you have separate machines for build and test and
want to perform the .info file creation on the build machine. See
\-\-to\-package for more information.
.RE
.B \-\-gcov\-tool
.I tool
.br
.RS
Specify the location of the gcov tool.
.RE
.B \-h
.br
.B \-\-help
.br
.RS
Print a short help text, then exit.
.RE
.B \-\-include
.I pattern
.br
.RS
Include source files matching
.IR pattern .
Use this switch if you want to include coverage data for only a particular set
of source files matching any of the given patterns. Multiple patterns can be
specified by using multiple
.B --include
command line switches. The
.I patterns
will be interpreted as shell wildcard patterns (note that they may need to be
escaped accordingly to prevent the shell from expanding them first).
.RE
.B \-\-ignore\-errors
.I errors
.br
.RS
Specify a list of errors after which to continue processing.
Use this option to specify a list of one or more classes of errors after which
lcov should continue processing instead of aborting.
.I errors
can be a comma\-separated list of the following keywords:
.B gcov:
the gcov tool returned with a non\-zero return code.
.B source:
the source code file for a data set could not be found.
.B graph:
the graph file could not be found or is corrupted.
.RE
.B \-i
.br
.B \-\-initial
.RS
Capture initial zero coverage data.
Run lcov with \-c and this option on the directories containing .bb, .bbg
or .gcno files before running any test case. The result is a "baseline"
coverage data file that contains zero coverage for every instrumented line.
Combine this data file (using lcov \-a) with coverage data files captured
after a test run to ensure that the percentage of total lines covered is
correct even when not all source code files were loaded during the test.
Recommended procedure when capturing data for a test case:
1. create baseline coverage data file
.RS
# lcov \-c \-i \-d appdir \-o app_base.info
.br
.RE
2. perform test
.RS
# appdir/test
.br
.RE
3. create test coverage data file
.RS
# lcov \-c \-d appdir \-o app_test.info
.br
.RE
4. combine baseline and test coverage data
.RS
# lcov \-a app_base.info \-a app_test.info \-o app_total.info
.br
.RE
.RE
.B \-k
.I subdirectory
.br
.B \-\-kernel\-directory
.I subdirectory
.br
.RS
Capture kernel coverage data only from
.IR subdirectory .
Use this option if you don't want to get coverage data for all of the
kernel, but only for specific subdirectories. This option may be specified
more than once.
Note that you may need to specify the full path to the kernel subdirectory
depending on the version of the kernel gcov support.
.RE
.B \-l
.I tracefile
.br
.B \-\-list
.I tracefile
.br
.RS
List the contents of the
.IR tracefile .
Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE
.B \-\-list\-full\-path
.br
.B \-\-no\-list\-full\-path
.br
.RS
Specify whether to show full paths during list operation.
Use \-\-list\-full\-path to show full paths during list operation
or \-\-no\-list\-full\-path to show shortened paths. Paths are
.B shortened
by default.
.RE
.B \-\-no\-markers
.br
.RS
Use this option if you want to get coverage data without regard to exclusion
markers in the source code file. See
.BR "geninfo " (1)
for details on exclusion markers.
.RE
.B \-\-no\-recursion
.br
.RS
Use this option if you want to get coverage data for the specified directory
only without processing subdirectories.
.RE
.B \-o
.I tracefile
.br
.B \-\-output\-file
.I tracefile
.br
.RS
Write data to
.I tracefile
instead of stdout.
Specify "\-" as a filename to use the standard output.
By convention, lcov\-generated coverage data files are called "tracefiles" and
should have the filename extension ".info".
.RE
.B \-\-path
.I path
.br
.RS
Strip path from filenames when applying diff.
Use this option together with \-\-diff to tell lcov to disregard the specified
initial path component when matching between tracefile and diff filenames.
.RE
.B \-q
.br
.B \-\-quiet
.br
.RS
Do not print progress messages.
This option is implied when no output filename is specified to prevent
progress messages to mess with coverage data which is also printed to
the standard output.
.RE
.B \-\-rc
.IR keyword = value
.br
.RS
Override a configuration directive.
Use this option to specify a
.IR keyword = value
statement which overrides the corresponding configuration statement in
the lcovrc configuration file. You can specify this option more than once
to override multiple configuration statements.
See
.BR lcovrc (5)
for a list of available keywords and their meaning.
.RE
.B \-r
.I tracefile
.I pattern
.br
.B \-\-remove
.I tracefile
.I pattern
.br
.RS
Remove data from
.IR tracefile .
Use this switch if you want to remove coverage data for a particular
set of files from a tracefile. Additional command line parameters will be
interpreted as shell wildcard patterns (note that they may need to be
escaped accordingly to prevent the shell from expanding them first).
Every file entry in
.I tracefile
which matches at least one of those patterns will be removed.
The result of the remove operation will be written to stdout or the tracefile
specified with \-o.
Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE
.B \-\-strip
.I depth
.br
.RS
Strip path components when applying diff.
Use this option together with \-\-diff to tell lcov to disregard the specified
number of initial directories when matching tracefile and diff filenames.
.RE
.B \-\-summary
.I tracefile
.br
.RS
Show summary coverage information for the specified tracefile.
Note that you may specify this option more than once.
Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE
.B \-t
.I testname
.br
.B \-\-test\-name
.I testname
.br
.RS
Specify test name to be stored in the tracefile.
This name identifies a coverage data set when more than one data set is merged
into a combined tracefile (see option \-a).
Valid test names can consist of letters, decimal digits and the underscore
character ("_").
.RE
.B \-\-to\-package
.I package
.br
.RS
Store .da files for later processing.
Use this option if you have separate machines for build and test and
want to perform the .info file creation on the build machine. To do this,
follow these steps:
On the test machine:
.RS
.br
\- run the test
.br
\- run lcov \-c [\-d directory] \-\-to-package
.I file
.br
\- copy
.I file
to the build machine
.RE
.br
On the build machine:
.RS
.br
\- run lcov \-c \-\-from-package
.I file
[\-o and other options]
.RE
.br
This works for both kernel and user space coverage data. Note that you might
have to specify the path to the build directory using \-b with
either \-\-to\-package or \-\-from-package. Note also that the package data
must be converted to a .info file before recompiling the program or it will
become invalid.
.RE
.B \-v
.br
.B \-\-version
.br
.RS
Print version number, then exit.
.RE
.B \-z
.br
.B \-\-zerocounters
.br
.RS
Reset all execution counts to zero.
By default tries to reset kernel execution counts. Use the \-\-directory
option to reset all counters of a user space program.
Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE
.SH FILES
.I /etc/lcovrc
.RS
The system\-wide configuration file.
.RE
.I ~/.lcovrc
.RS
The per\-user configuration file.
.RE
.SH AUTHOR
Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>
.SH SEE ALSO
.BR lcovrc (5),
.BR genhtml (1),
.BR geninfo (1),
.BR genpng (1),
.BR gendesc (1),
.BR gcov (1)
.TH lcovrc 5 "LCOV 1.14" 2019\-02\-28 "User Manuals"
.SH NAME
lcovrc \- lcov configuration file
.SH DESCRIPTION
The
.I lcovrc
file contains configuration information for the
.B lcov
code coverage tool (see
.BR lcov (1)).
.br
The system\-wide configuration file is located at
.IR /etc/lcovrc .
To change settings for a single user, place a customized copy of this file at
location
.IR ~/.lcovrc .
Where available, command\-line options override configuration file settings.
Lines in a configuration file can either be:
.IP " *"
empty lines or lines consisting only of white space characters. These lines are
ignored.
.IP " *"
comment lines which start with a hash sign ('#'). These are treated like empty
lines and will be ignored.
.IP " *"
statements in the form
.RI ' key " = " value '.
A list of valid statements and their description can be found in
section 'OPTIONS' below.
.PP
.B Example configuration:
.IP
#
.br
# Example LCOV configuration file
.br
#
.br
# External style sheet file
.br
#genhtml_css_file = gcov.css
.br
# Coverage rate limits
.br
genhtml_hi_limit = 90
.br
genhtml_med_limit = 75
.br
# Width of line coverage field in source code view
.br
genhtml_line_field_width = 12
.br
# Width of branch coverage field in source code view
.br
genhtml_branch_field_width = 16
.br
# Width of overview image
.br
genhtml_overview_width = 80
.br
# Resolution of overview navigation
.br
genhtml_nav_resolution = 4
.br
# Offset for source code navigation
.br
genhtml_nav_offset = 10
.br
# Do not remove unused test descriptions if non\-zero
.br
genhtml_keep_descriptions = 0
.br
# Do not remove prefix from directory names if non\-zero
.br
genhtml_no_prefix = 0
.br
# Do not create source code view if non\-zero
.br
genhtml_no_source = 0
.br
# Specify size of tabs
.br
genhtml_num_spaces = 8
.br
# Highlight lines with converted\-only data if non\-zero
.br
genhtml_highlight = 0
.br
# Include color legend in HTML output if non\-zero
.br
genhtml_legend = 0
.br
# Include HTML file at start of HTML output
.br
#genhtml_html_prolog = prolog.html
.br
# Include HTML file at end of HTML output
.br
#genhtml_html_epilog = epilog.html
.br
# Use custom HTML file extension
.br
#genhtml_html_extension = html
.br
# Compress all generated html files with gzip.
.br
#genhtml_html_gzip = 1
.br
# Include sorted overview pages
.br
genhtml_sort = 1
.br
# Include function coverage data display
.br
#genhtml_function_coverage = 1
.br
# Include branch coverage data display
.br
#genhtml_branch_coverage = 1
.br
# Specify the character set of all generated HTML pages
.br
genhtml_charset=UTF\-8
.br
# Allow HTML markup in test case description text if non\-zero
.br
genhtml_desc_html=0
.br
# Specify the precision for coverage rates
.br
#genhtml_precision=1
.br
# Show missed counts instead of hit counts
.br
#genhtml_missed=1
.br
# Demangle C++ symbols
.br
#genhtml_demangle_cpp=1
.br
# Location of the gcov tool
.br
#geninfo_gcov_tool = gcov
.br
# Adjust test names if non\-zero
.br
#geninfo_adjust_testname = 0
.br
# Calculate a checksum for each line if non\-zero
.br
geninfo_checksum = 0
.br
# Enable libtool compatibility mode if non\-zero
.br
geninfo_compat_libtool = 0
.br
# Specify whether to capture coverage data for external source
.br
# files
.br
#geninfo_external = 1
.br
# Use gcov's --all-blocks option if non-zero
.br
#geninfo_gcov_all_blocks = 1
.br
# Specify compatiblity modes (same as \-\-compat option
.br
# of geninfo)
.br
#geninfo_compat = libtool=on, hammer=auto, split_crc=auto
.br
# Adjust path to source files by removing or changing path
.br
# components that match the specified pattern (Perl regular
.br
# expression format)
.br
#geninfo_adjust_src_path = /tmp/build => /usr/src
# Specify if geninfo should try to automatically determine
.br
# the base-directory when collecting coverage data.
.br
geninfo_auto_base = 1
.br
# Directory containing gcov kernel files
.br
lcov_gcov_dir = /proc/gcov
.br
# Location for temporary directories
.br
lcov_tmp_dir = /tmp
.br
# Show full paths during list operation if non\-zero
.br
lcov_list_full_path = 0
.br
# Specify the maximum width for list output. This value is
.br
# ignored when lcov_list_full_path is non\-zero.
.br
lcov_list_width = 80
.br
# Specify the maximum percentage of file names which may be
.br
# truncated when choosing a directory prefix in list output.
.br
# This value is ignored when lcov_list_full_path is non\-zero.
.br
lcov_list_truncate_max = 20
# Specify if function coverage data should be collected and
.br
# processed.
.br
lcov_function_coverage = 1
.br
# Specify if branch coverage data should be collected and
.br
# processed.
.br
lcov_branch_coverage = 0
.br
.PP
.SH OPTIONS
.BR genhtml_css_file " ="
.I filename
.IP
Specify an external style sheet file. Use this option to modify the appearance of the HTML output as generated by
.BR genhtml .
During output generation, a copy of this file will be placed in the output
directory.
.br
This option corresponds to the \-\-css\-file command line option of
.BR genhtml .
.br
By default, a standard CSS file is generated.
.PP
.BR genhtml_hi_limit " ="
.I hi_limit
.br
.BR genhtml_med_limit " ="
.I med_limit
.br
.IP
Specify coverage rate limits for classifying file entries. Use this option to
modify the coverage rates (in percent) for line, function and branch coverage at
which a result is classified as high, medium or low coverage. This
classification affects the color of the corresponding entries on the overview
pages of the HTML output:
.br
High: hi_limit <= rate <= 100 default color: green
.br
Medium: med_limit <= rate < hi_limit default color: orange
.br
Low: 0 <= rate < med_limit default color: red
.br
Defaults are 90 and 75 percent.
.PP
.BR genhtml_line_field_width " ="
.I number_of_characters
.IP
Specify the width (in characters) of the source code view column containing
line coverage information.
.br
Default is 12.
.PP
.BR genhtml_branch_field_width " ="
.I number_of_characters
.IP
Specify the width (in characters) of the source code view column containing
branch coverage information.
.br
Default is 16.
.PP
.BR genhtml_overview_width " ="
.I pixel_size
.IP
Specify the width (in pixel) of the overview image created when generating HTML
output using the \-\-frames option of
.BR genhtml .
.br
Default is 80.
.PP
.BR genhtml_nav_resolution " ="
.I lines
.IP
Specify the resolution of overview navigation when generating HTML output using
the \-\-frames option of
.BR genhtml .
This number specifies the maximum difference in lines between the position a
user selected from the overview and the position the source code window is
scrolled to.
.br
Default is 4.
.PP
.BR genhtml_nav_offset " ="
.I lines
.IP
Specify the overview navigation line offset as applied when generating HTML
output using the \-\-frames option of
.BR genhtml.
.br
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.
.br
Default is 10.
.PP
.BR genhtml_keep_descriptions " ="
.IR 0 | 1
.IP
If non\-zero, keep unused test descriptions when generating HTML output using
.BR genhtml .
.br
This option corresponds to the \-\-keep\-descriptions option of
.BR genhtml .
.br
Default is 0.
.PP
.BR genhtml_no_prefix " ="
.IR 0 | 1
.IP
If non\-zero, do not try to find and remove a common prefix from directory names.
.br
This option corresponds to the \-\-no\-prefix option of
.BR genhtml .
.br
Default is 0.
.PP
.BR genhtml_no_source " ="
.IR 0 | 1
.IP
If non\-zero, do not create a source code view when generating HTML output using
.BR genhtml .
.br
This option corresponds to the \-\-no\-source option of
.BR genhtml .
.br
Default is 0.
.PP
.BR genhtml_num_spaces " ="
.I num
.IP
Specify the number of spaces to use as replacement for tab characters in the
HTML source code view as generated by
.BR genhtml .
.br
This option corresponds to the \-\-num\-spaces option of
.BR genthml .
.br
Default is 8.
.PP
.BR genhtml_highlight " ="
.IR 0 | 1
.IP
If non\-zero, highlight lines with converted\-only data in
HTML output as generated by
.BR genhtml .
.br
This option corresponds to the \-\-highlight option of
.BR genhtml .
.br
Default is 0.
.PP
.BR genhtml_legend " ="
.IR 0 | 1
.IP
If non\-zero, include a legend explaining the meaning of color coding in the HTML
output as generated by
.BR genhtml .
.br
This option corresponds to the \-\-legend option of
.BR genhtml .
.br
Default is 0.
.PP
.BR genhtml_html_prolog " ="
.I filename
.IP
If set, include the contents of the specified file at the beginning of HTML
output.
This option corresponds to the \-\-html\-prolog option of
.BR genhtml .
.br
Default is to use no extra prolog.
.PP
.BR genhtml_html_epilog " ="
.I filename
.IP
If set, include the contents of the specified file at the end of HTML output.
This option corresponds to the \-\-html\-epilog option of
.BR genhtml .
.br
Default is to use no extra epilog.
.PP
.BR genhtml_html_extension " ="
.I extension
.IP
If set, use the specified string as filename extension for generated HTML files.
This option corresponds to the \-\-html\-extension option of
.BR genhtml .
.br
Default extension is "html".
.PP
.BR genhtml_html_gzip " ="
.IR 0 | 1
.IP
If set, compress all html files using gzip.
This option corresponds to the \-\-html\-gzip option of
.BR genhtml .
.br
Default extension is 0.
.PP
.BR genhtml_sort " ="
.IR 0 | 1
.IP
If non\-zero, create overview pages sorted by coverage rates when generating
HTML output using
.BR genhtml .
.br
This option can be set to 0 by using the \-\-no\-sort option of
.BR genhtml .
.br
Default is 1.
.PP
.BR genhtml_function_coverage " ="
.IR 0 | 1
.IP
If non\-zero, include function coverage data when generating HTML output using
.BR genhtml .
.br
This option can be set to 0 by using the \-\-no\-function\-coverage option of
.BR genhtml .
.br
Default is 1.
.PP
.BR genhtml_branch_coverage " ="
.IR 0 | 1
.IP
If non\-zero, include branch coverage data when generating HTML output using
.BR genhtml .
.br
This option can be set to 0 by using the \-\-no\-branch\-coverage option of
.BR genhtml .
.br
Default is 1.
.PP
.BR genhtml_charset " ="
.I charset
.IP
Specify the character set of all generated HTML pages.
.br
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
.BR genhtml_html_prolog ).
.br
Default is UTF-8.
.PP
.BR genhtml_demangle_cpp " ="
.IR 0 | 1
.IP
If non-zero, demangle C++ function names in function overviews.
Set this option to one if you want to convert C++ internal function
names to human readable format for display on the HTML function overview
page. This option requires that the c++filt tool is installed (see
.BR c++filt(1)
).
.br
This option corresponds to the \-\-demangle\-cpp command line option of
.BR genhtml .
.br
Default is 0.
.PP
.BR genhtml_desc_html " ="
.IR 0 | 1
.IP
If non-zero, test case descriptions may contain HTML markup.
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.
.br
Default is 0.
.PP
.BR genhtml_precision " ="
.IR 1 | 2 | 3 | 4
.IP
Specify how many digits after the decimal-point should be used for
displaying coverage rates.
.br
Default is 1.
.PP
.BR genhtml_missed " ="
.IR 0 | 1
.IP
If non-zero, the count of missed lines, functions, or branches is shown
as negative numbers in overview pages.
.br
Default is 0.
.PP
.
.BR geninfo_gcov_tool " ="
.I path_to_gcov
.IP
Specify the location of the gcov tool (see
.BR gcov (1))
which is used to generate coverage information from data files.
.br
Default is 'gcov'.
.PP
.BR geninfo_adjust_testname " ="
.IR 0 | 1
.IP
If non\-zero, adjust test names to include operating system information
when capturing coverage data.
.br
Default is 0.
.PP
.BR geninfo_checksum " ="
.IR 0 | 1
.IP
If non\-zero, generate source code checksums when capturing coverage data.
Checksums are useful to prevent merging coverage data from incompatible
source code versions but checksum generation increases the size of coverage
files and the time used to generate those files.
.br
This option corresponds to the \-\-checksum and \-\-no\-checksum command line
option of
.BR geninfo .
.br
Default is 0.
.PP
.BR geninfo_compat_libtool " ="
.IR 0 | 1
.IP
If non\-zero, enable libtool compatibility mode. When libtool compatibility
mode is enabled, lcov will assume that the source code relating to a .da file
located in a directory named ".libs" can be found in its parent directory.
.br
This option corresponds to the \-\-compat\-libtool and \-\-no\-compat\-libtool
command line option of
.BR geninfo .
.br
Default is 1.
.PP
.BR geninfo_external " ="
.IR 0 | 1
.IP
If non\-zero, capture coverage data for external source files.
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
.BR lcov / geninfo .
Default is 1.
.PP
.BR geninfo_gcov_all_blocks " ="
.IR 0 | 1
.IP
If non\-zero, call the gcov tool with option --all-blocks.
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 analysing some files.
Default is 1.
.PP
.BR geninfo_compat " ="
.IR mode = value [, mode = value ,...]
.IP
Specify that geninfo should enable one or more compatibility modes
when capturing coverage data.
This option corresponds to the \-\-compat command line option of
.BR geninfo .
Default is 'libtool=on, hammer=auto, split_crc=auto'.
.PP
.BR geninfo_adjust_src_path " ="
.IR pattern " => " replacement
.br
.BR geninfo_adjust_src_path " ="
.I pattern
.IP
Adjust source paths when capturing coverage data.
Use this option in situations where geninfo cannot find the correct
path to source code files of a project. By providing a
.I pattern
in Perl regular expression format (see
.BR perlre (1))
and an optional replacement string, you can instruct geninfo to
remove or change parts of the incorrect source path.
.B Example:
.br
1. When geninfo reports that it cannot find source file
.br
/path/to/src/.libs/file.c
.br
while the file is actually located in
.br
/path/to/src/file.c
.br
use the following parameter:
.br
geninfo_adjust_src_path = /.libs
This will remove all "/.libs" strings from the path.
2. When geninfo reports that it cannot find source file
.br
/tmp/build/file.c
.br
while the file is actually located in
.br
/usr/src/file.c
.br
use the following parameter:
.br
geninfo_adjust_src_path = /tmp/build => /usr/src
.br
This will change all "/tmp/build" strings in the path to "/usr/src".
.PP
.BR geninfo_auto_base " ="
.IR 0 | 1
.IP
If non\-zero, apply a heuristic to determine the base directory when
collecting coverage data.
.br
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 ist not the same directory in which the source code file is
located, and in addition, is different between files of the same project.
.br
Default is 1.
.PP
.BR lcov_gcov_dir " ="
.I path_to_kernel_coverage_data
.IP
Specify the path to the directory where kernel coverage data can be found
or leave undefined for auto-detection.
.br
Default is auto-detection.
.PP
.BR lcov_tmp_dir " ="
.I temp
.IP
Specify the location of a directory used for temporary files.
.br
Default is '/tmp'.
.PP
.BR lcov_list_full_path " ="
.IR 0 | 1
.IP
If non-zero, print the full path to source code files during a list operation.
.br
This option corresponds to the \-\-list\-full\-path option of
.BR lcov .
.br
Default is 0.
.PP
.BR lcov_list_max_width " ="
.IR width
.IP
Specify the maximum width for list output. This value is ignored when
lcov_list_full_path is non\-zero.
.br
Default is 80.
.PP
.BR lcov_list_truncate_max
.B " ="
.IR percentage
.IP
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.
.br
Default is 20.
.PP
.BR lcov_function_coverage " ="
.IR 0 | 1
.IP
Specify whether lcov should handle function coverage data.
.br
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. Note that setting
.B genhtml_function_coverage
will override this option for HTML generation.
.br
Default is 1.
.PP
.BR lcov_branch_coverage " ="
.IR 0 | 1
.IP
Specify whether lcov should handle branch coverage data.
.br
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. Note that setting
.B genhtml_branch_coverage
will override this option for HTML generation.
.br
Default is 0.
.PP
.BR lcov_excl_line " ="
.I expression
.IP
Specify the regular expression of lines to exclude.
.br
Default is 'LCOV_EXCL_LINE'.
.PP
.BR lcov_excl_br_line " ="
.I expression
.IP
Specify the regular expression of lines to exclude from branch coverage.
.br
Default is 'LCOV_EXCL_BR_LINE'.
.PP
.SH FILES
.TP
.I /etc/lcovrc
The system\-wide
.B lcov
configuration file.
.TP
.I ~/.lcovrc
The individual per\-user configuration file.
.PP
.SH SEE ALSO
.BR lcov (1),
.BR genhtml (1),
.BR geninfo (1),
.BR gcov (1)
Summary: A graphical GCOV front-end
Name: lcov
Version: 1.14
Release: 1
License: GPLv2+
Group: Development/Tools
URL: http://ltp.sourceforge.net/coverage/lcov.php
Source0: http://downloads.sourceforge.net/ltp/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildArch: noarch
Requires: perl >= 5.8.8
%description
LCOV is a graphical front-end for GCC's coverage testing tool gcov. It collects
gcov data for multiple source files and creates HTML pages containing the
source code annotated with coverage information. It also adds overview pages
for easy navigation within the file structure.
%prep
%setup -q -n %{name}-%{version}
%build
exit 0
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT PREFIX=/usr CFG_DIR=/etc
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
/usr/bin/*
/usr/share/man/man*/*
%config /etc/*
%changelog
* Mon Aug 22 2016 Peter Oberparleiter (Peter.Oberparleiter@de.ibm.com)
- updated "make install" call to work with PREFIX Makefile changes
* Mon May 07 2012 Peter Oberparleiter (Peter.Oberparleiter@de.ibm.com)
- added dependency on perl 5.8.8 for >>& open mode support
* Wed Aug 13 2008 Peter Oberparleiter (Peter.Oberparleiter@de.ibm.com)
- changed description + summary text
* Mon Aug 20 2007 Peter Oberparleiter (Peter.Oberparleiter@de.ibm.com)
- fixed "Copyright" tag
* Mon Jul 14 2003 Peter Oberparleiter (Peter.Oberparleiter@de.ibm.com)
- removed variables for version/release to support source rpm building
- added initial rm command in install section
* Mon Apr 7 2003 Peter Oberparleiter (Peter.Oberparleiter@de.ibm.com)
- implemented variables for version/release
* Fri Oct 18 2002 Peter Oberparleiter (Peter.Oberparleiter@de.ibm.com)
- created initial spec file
include common.mak
TESTDIRS := $(sort $(patsubst %/,%,$(dir $(wildcard */Makefile))))
help: info
info:
echo "Available make targets:"
echo " test : perform self-tests"
echo " clean : remove all temporary files"
echo ""
echo "Available make variables:"
echo " SIZE : specify size of test data (small, medium, large)"
echo " V : specify level of verbosity (0, 1, 2)"
test:
for TEST in $(TESTDIRS) ; do \
make -C $$TEST test ; \
done
clean:
rm -rf *.info *.counts test.log src/
for TEST in $(TESTDIRS) ; do \
make -C $$TEST clean ; \
done
.PHONY: help info test clean
function elapsed_to_ms()
{
local ELAPSED=$1
local IFS=:.
local MS
set -- $ELAPSED
if [ $# -eq 3 ] ; then
let MS=${3#0}*10+${2#0}*1000+$1*60000
else
let MS=${4#0}*10+${3#0}*1000+${2#0}*60000+$1*3600000
fi
echo $MS
}
function t_timestamp()
{
date +"%Y-%m-%d %H:%M:%S %z"
}
function t_marker()
{
echo
echo "======================================================================"
}
function t_detail()
{
local KEY=$1
local VALUE=$2
local DOTS=" ............"
printf "%-.12s: %s\n" "$KEY$DOTS" "$VALUE"
}
function t_announce()
{
local TESTNAME="$1"
printf "$BOLD%-.30s$RESET " "$TESTNAME .............................."
t_marker >> "$LOGFILE"
t_detail "DATE" "$(t_timestamp)" >> "$LOGFILE"
t_detail "TESTNAME" "$TESTNAME" >> "$LOGFILE"
}
function t_result()
{
local COLOR="$1"
local TEXT="$2"
printf "[$COLOR$TEXT$RESET]"
}
function t_pass()
{
local TESTNAME="$1"
t_result "$GREEN" "pass"
echo "pass $TESTNAME" >> "$COUNTFILE"
}
function t_fail()
{
local TESTNAME="$1"
t_result "$RED" "fail"
echo "fail $TESTNAME" >> "$COUNTFILE"
}
function t_kill()
{
local TESTNAME="$1"
t_result "$RED" "kill"
echo "fail $TESTNAME" >> "$COUNTFILE"
}
function t_skip()
{
local TESTNAME="$1"
t_result "$BLUE" "skip"
echo "skip $TESTNAME" >> "$COUNTFILE"
}
function t_indent()
{
sed -e 's/^/ /'
}
LOGFILE="$TOPDIR/test.log"
COUNTFILE="$TOPDIR/test.counts"
TIMEFILE="$TOPDIR/test.time"
if [ -t 1 ] ; then
RED="\e[31m"
GREEN="\e[32m"
BLUE="\e[34m"
BOLD="\e[1m"
DEFAULT="\e[39m"
RESET="\e[0m"
fi