Skip to content

Commit 0a33c54

Browse files
authored
Update README
Clarification + fix typos Signed-off-by: Henry Cox <[email protected]> Signed-off-by: Henry Cox <[email protected]>
1 parent 5024a98 commit 0a33c54

File tree

1 file changed

+38
-23
lines changed

1 file changed

+38
-23
lines changed

README

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
-------------------------------------------------
22
- README file for the LTP GCOV extension (LCOV) -
3-
- Last changes: 2024-12-16
3+
- Last changes: 2024-12-25
44
-------------------------------------------------
55

66
Description
77
-----------
8-
LCOV is an extension of GCOV, a GNU tool which provides information about
9-
what parts of a program are actually executed (i.e. "covered") while running
10-
a particular test case. The extension consists of a set of Perl scripts
11-
which build on the textual GCOV output to implement the following enhanced
8+
LCOV is a tool to manipulate and display information about what parts of a
9+
program are actually executed (i.e. "covered") while running a particular test
10+
case or set of testcases. LCOV consists of a set of Perl scripts which build on
11+
the text output of various coverage tools - e.g., gcov, llvm-cov, Coverage.py,
12+
Cobertura, Devel::Cover, Jacoco, etc. - to implement the following enhanced
1213
functionality:
1314

14-
* HTML based output: coverage rates are additionally indicated using bar
15-
graphs and specific colors.
15+
* HTML based output: coverage rates are indicated using bar
16+
graphs and specific colors in a hyperlinked coverage report, intended
17+
to enable the user to quickly diagnose and address coverage issues.
1618

1719
* Support for large projects: overview pages allow quick browsing of
1820
coverage data by providing a hierarchical directory structure
19-
view, a flat list of all source files in the project, or a three-level
21+
view, a flat list of all source files in the project, or a three-level
2022
detail view: directory, file and source code view.
2123

2224
* Support for multiple languages - including C/C++, Perl, and Python.
@@ -25,7 +27,7 @@ Description
2527
but works as well for coverage measurements on standard user space
2628
applications.
2729

28-
LCOV supports differential coverage, as well as date- and owner-binning.
30+
LCOV supports differential coverage, as well as date- and owner-binning.
2931
See:
3032
https://arxiv.org/abs/2008.07947
3133
or
@@ -35,7 +37,7 @@ Description
3537
A video presentation of the basic ideas can be found at
3638
http://doi.org/10.5281/zenodo.4653252
3739

38-
In addition, several other features and capabilities have been added. See
40+
In addition, several other features and capabilities are available. See
3941
section 6, below, for a brief description - and also see the man pages and
4042
the test cases.
4143

@@ -205,6 +207,11 @@ Point the web browser of your choice to the resulting index.html file.
205207
$ gcc -c file1.c file2.c ... --coverage
206208
$ gcc -o myOtherTest --coverage file1.o file2.o ....
207209

210+
Alternately, LLVM users can use the 'profdata path' (rather than the
211+
'gcov path') to collect coverage data from their C/C++ code. See
212+
https://github.com/linux-test-project/lcov/discussions/234 for more
213+
information.
214+
208215
Run your testcase at least once:
209216

210217
$ path/to/my/testcase/myTest
@@ -213,11 +220,18 @@ Point the web browser of your choice to the resulting index.html file.
213220

214221
$ lcov --directory path/to/my/testcase --capture --output-file app.info
215222

223+
(LLVM users using the 'prodata path' will use a somewhat different
224+
command for this step - see the discussion referenced above.)
225+
216226
If you want to collect Modified Condition / Decision Coverage (MD/DC)
217227
date, then:
218-
- you must use gcc/14.2 or newer
219-
- your compile- and link command line must include flag
220-
'-fcondition-coverage'
228+
- you must use gcc/14.2 (or newer), or LLVM/18 (or newer)
229+
- your GCC compile- and link command line must include flag
230+
'-fcondition-coverage'.
231+
- LLVM users must use the 'prodata path' for coverage data collection,
232+
and your compile command line must include
233+
'-fprofile-inst-generate -fcoverage-mapping -fcoverage-mcdc'.
234+
See the above referenced discussion for details.
221235
- your lcov and genhtml command line must include flag
222236
'--mcdc-coverage'
223237
See the '--mcdc-coverage' section in the lcov and geninfo man pages.
@@ -374,8 +388,8 @@ LCOV features and capabilities fall into 7 major categories:
374388

375389
During coverage data capture, the --build-directory option can be used
376390
to specify a search path, to find the .gcno (compile-time coverage data)
377-
file corresponding to a particular .gcda runtime coverage data) file.
378-
Similarly, the --source-directory pption can be used to specify a
391+
file corresponding to a particular .gcda (runtime coverage data) file.
392+
Similarly, the --source-directory option can be used to specify a
379393
search path for source files.
380394

381395
See the lcov/geninfo/genhtml man pages for a detailed description of
@@ -392,18 +406,19 @@ LCOV features and capabilities fall into 7 major categories:
392406

393407
i) interface with the revision control system
394408
Sample scripts:
395-
- Perforce: see 'p4diff' and 'p4annotate'
396-
- Git: see 'gitdiff' and 'gitblame'
409+
- Perforce: see 'p4diff', 'p4annotate.pm', 'p4annotate'
410+
- Git: see 'gitdiff', 'gitblame.pm', 'gitblame'
397411
ii) verify that source code versions are compatible, and
398-
Sample scripts: see 'get_signature', 'getp4version'
399-
and 'gitversion'
412+
Sample scripts: see 'get_signature', 'P4version.pm', 'getp4version',
413+
'gitversion', 'gitversion.pm', and 'batchGitVersion.pm'
400414
iii) enforce a desired code coverage criteria
401-
Sample script: criteria
415+
Sample script: criteria.pm/criteria
402416
iv) find source files in more complicated environments - where
403417
simple substitutions become complicated or unweildy.
404418
v) select a subset of coverage data to display - e.g., to
405419
use in a code review which wants to concentrate on only
406420
the changes caused by a particular commit or range of commits.
421+
Sample script: select.pm
407422
vi) keep track of environment and other settings - to aid
408423
infrastructure debugging in more complicated use cases.
409424

@@ -479,7 +494,7 @@ LCOV features and capabilities fall into 7 major categories:
479494
translates XML coverage data to lcov format.
480495
The XML data may come from Cobertura or similar tools.
481496

482-
See "xml2lcov --help" fir brief instructions on how to use
497+
See "xml2lcov --help" for brief instructions on how to use
483498
the translator.
484499
See the Coburtura documentation for directions on how to
485500
generate XML data.
@@ -496,8 +511,8 @@ file. See the lcovrc man page for details.
496511
-------------------------
497512
See the included man pages for more information on how to use the LCOV tools.
498513

499-
In case of further questions, feel free to open a new issue using the issue
500-
tracker on the LCOV code repository site at:
514+
In case of further questions, feel free to open a new issue or discussion using
515+
the issue tracker on the LCOV code repository site at:
501516

502517
https://github.com/linux-test-project/lcov
503518

0 commit comments

Comments
 (0)