| 1 |
To see some examples of LCOV generated HTML coverage reports, |
| 2 |
and point a web browser into the resulting reports: |
| 3 |
|
| 4 |
Default view: |
| 5 |
|
| 6 |
- Point your browser to |
| 7 |
output/index.html |
| 8 |
|
| 9 |
Hierarchical view: |
| 10 |
|
| 11 |
- Point your browser to |
| 12 |
hierarchical/index.html |
| 13 |
|
| 14 |
- Note that that the coverage data is the same - only the report |
| 15 |
format is different: |
| 16 |
|
| 17 |
- Follows directory structure, similar to MS file viewer |
| 18 |
('--hierarchical' flag) |
| 19 |
|
| 20 |
- Additional navigation links also enabled |
| 21 |
('--show-navigation' flag) |
| 22 |
|
| 23 |
Differential coverage: |
| 24 |
|
| 25 |
- Point your browser to |
| 26 |
exampleRepo/differential/index.html |
| 27 |
|
| 28 |
- This example is slightly complicated because it emulates a moderately |
| 29 |
realistic project in that it pretends to see project changes: |
| 30 |
|
| 31 |
- updates to two project source files example.c and iterate.c |
| 32 |
|
| 33 |
- change to the test suite: only one test of updated |
| 34 |
code rather than 3 of the original code |
| 35 |
|
| 36 |
- The Makefile simulates this by checking code into a git repo, |
| 37 |
building an executable and then updating a few source files, rebuildling, |
| 38 |
and running some tests. |
| 39 |
|
| 40 |
Code review: |
| 41 |
|
| 42 |
- point your browser to |
| 43 |
exampleRepo/differential/index.html |
| 44 |
|
| 45 |
- This example builds on the "Differential coverage" example, above |
| 46 |
to emulate a possible code review methodology in which adds code |
| 47 |
coverage to the review criteria. |
| 48 |
The intent is to generate a reduced report which shows only the |
| 49 |
code changes which negatively affect code coverage - while removing |
| 50 |
other details which only distract from the review. |
| 51 |
|
| 52 |
- Use the 'genhtml --select-script ...' feature to show only new |
| 53 |
source code which was negatively affected by the change under |
| 54 |
review (uncovered and/or lost code). |
| 55 |
You might want to modify the select criteria to include positive |
| 56 |
change (e.g., GNC, GBC, and GIC categories). |
| 57 |
|
| 58 |
- Real use cases are likely to use more sophisticated select-script |
| 59 |
callbacks (e.g., to select from a range of changelists). |
| 60 |
|
| 61 |
Feel free to edit the Makefile or to run the lcov utilities directly, |
| 62 |
to see the effect of other options that you find in the lcov man pages. |