You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is similiar to 'excluded regions' - except that lcov will generate an 'unreachable' message if any coverpoints in the region are hit.
Signed-off-by: Henry Cox <[email protected]>
Copy file name to clipboardExpand all lines: man/genhtml.1
+16-2Lines changed: 16 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2301,12 +2301,12 @@ Ignore line and branch coverpoints on lines which are out-of range/whose line nu
2301
2301
.PP
2302
2302
2303
2303
.IPregion:3
2304
-
apply LCOV_EXCL_START/LCOV_EXCL_STOP directives found in source text to the coverpoints found in the current and baseline .info files.
2304
+
apply LCOV_EXCL_START/LCOV_EXCL_STOP/LCOV_EXCL_LINE and LCOV_UNREACHABLE_START/LCOV_UNREACHABLE_STOP/LCOV_UNREACHABLE_LINE directives found in source text to the coverpoints found in the current and baseline .info files.
2305
2305
This option may be useful in cases that the source code was not found during 'lcov \-\-capture ...' but is accessible now.
2306
2306
.PP
2307
2307
2308
2308
.IPbranch_region:3
2309
-
apply LCOV_EXCL_BR_START/LCOV_EXCL_BR_STOP directives found in source text to the coverpoints found in the current and baseline .info files.
2309
+
apply LCOV_EXCL_BR_START/LCOV_EXCL_BR_STOP/LCOV_EXCL_BR_LINE directives found in source text to the coverpoints found in the current and baseline .info files.
2310
2310
This is similar to the 'region option, above - but applies to branch coverpoints only.
2311
2311
.PP
2312
2312
@@ -3130,6 +3130,20 @@ Coverage data for a particular line cannot be found, possibly because the source
3130
3130
This can happen if the source file used in HTML generation is not the same as the file used to generate the coverage data - for example, lines have been added or removed.
3131
3131
.PP
3132
3132
3133
+
.IPunreachable:3
3134
+
a coverpoint (line, branch, function, or MC/DC) within an "unreachable" region is executed (hit); either the code, directive placement, or both are wrong.
3135
+
If the error is ignored, the offending coverpoint is retained (not excluded) or not, depending on the value of the
3136
+
.Iretain_unreachable_coverpoints_if_executed
3137
+
configuration parameter.
3138
+
See man
3139
+
.Blcovrc(5)
3140
+
and the
3141
+
.I"Exclusionmarkers"
3142
+
section of man
3143
+
.Bgeninfo(1)
3144
+
for more information.
3145
+
.PP
3146
+
3133
3147
.IPunsupported:3
3134
3148
The requested feature is not supported for this tool configuration. For example, function begin/end line range exclusions use some GCOV features that are not available in older GCC releases.
Copy file name to clipboardExpand all lines: man/geninfo.1
+64-6Lines changed: 64 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -233,13 +233,29 @@ man page for more information on .gcda, .gcno and .gcov output formats.
233
233
.SS "Exclusion markers"
234
234
235
235
To exclude specific lines of code from a tracefile, you can add exclusion
236
-
markers to the source code. Additionally you can exclude specific branches from
237
-
branch coverage without excluding the involved lines from line and function
238
-
coverage. Exclusion markers are keywords which can for example be added in the
236
+
markers to the source code. Similarly, you can mark specific regions of code
237
+
as "unreachable". An "unreachable" error message is generated if any
238
+
coverpoints in unreachable regions are executed (
239
+
.Ii.e.,
240
+
have non-zero hit counts.
241
+
See the
242
+
.Iretain_unreachable_coverpoints_if_executed
243
+
section in man
244
+
.Blcovrc(1)
245
+
for a description of the actions taken in this case.
246
+
247
+
Additionally you can exclude specific branches or MC/DC expressions from
248
+
without excluding the involved lines from line and function
249
+
coverage.
250
+
251
+
Exclusion markers are keywords which can for example be added in the
239
252
form of a comment.
240
253
See man
241
254
.BR lcovrc (5)
242
-
how to override some of them.
255
+
how to override the exclusion keywords (
256
+
.Ie.g.,
257
+
to reuse markers inserted for other tools or to generate reports with different
258
+
sets of excluded regions).
243
259
244
260
The following markers are recognized by geninfo:
245
261
@@ -266,6 +282,34 @@ section.
266
282
.br
267
283
.RE
268
284
285
+
.BLCOV_UNREACHABLE_LINE
286
+
.br
287
+
.RS
288
+
If the marked line is 'hit', then generate an error: we believe the marked code
289
+
is unreachable and so there is a bug in the code, the plaement of the directive, or both.
290
+
Lines containing this marker will be excluded from reporting.
291
+
.br
292
+
Apart from error reporting, this directive is equivalent to
293
+
.ILCOV_EXCL_LINE.
294
+
.RE
295
+
296
+
.BLCOV_UNREACHABLE_START
297
+
.br
298
+
.RS
299
+
Marks the beginning of an unreachable section of code. The current line in part of this region.
300
+
.br
301
+
As described in the
302
+
.ILCOV_UNREACHABLE_LINE
303
+
section, above: an error is generated if any code in the region is hit, but the code is excluded from reporting.
304
+
.RE
305
+
306
+
.BLCOV_UNREACHABLE_STOP
307
+
.br
308
+
.RS
309
+
Marks the end of the region of unreachable code. The current line not part of this
310
+
section.
311
+
.RE
312
+
269
313
.BLCOV_EXCL_BR_LINE
270
314
.br
271
315
.RS
@@ -319,7 +363,9 @@ The current line not part of this section
319
363
In general, (almost) all
320
364
.Bgeninfo
321
365
options can also be specified in your personal, group, project, or site
322
-
configuration file - see man
366
+
configuration file - see the
367
+
.I\-\-config\-file
368
+
section, below, and man
323
369
.Blcovrc(5)
324
370
for details.
325
371
@@ -1013,7 +1059,19 @@ data.
1013
1059
.IPsource:3
1014
1060
the source code file for a data set could not be found.
1015
1061
.PP
1016
-
`<
1062
+
1063
+
.IPunreachable:3
1064
+
a coverpoint (line, branch, function, or MC/DC) within an "unreachable" region is executed (hit); either the code, directive placement, or both are wrong.
1065
+
If the error is ignored, the offending coverpoint is retained (not excluded) or not, depending on the value of the
1066
+
.Iretain_unreachable_coverpoints_if_executed
1067
+
configuration parameter.
1068
+
See man
1069
+
.Blcovrc(5)
1070
+
and the
1071
+
.I"Exclusionmarkers"
1072
+
section, above.
1073
+
.PP
1074
+
1017
1075
.IPunsupported:3
1018
1076
the requested feature is not supported for this tool configuration. For example, function begin/end line range exclusions use some GCOV features that are not available in older GCC releases.
Copy file name to clipboardExpand all lines: man/lcov.1
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1445,6 +1445,20 @@ data.
1445
1445
the source code file for a data set could not be found.
1446
1446
.PP
1447
1447
1448
+
.IPunreachable:3
1449
+
a coverpoint (line, branch, function, or MC/DC) within an "unreachable" region is executed (hit); either the code, directive placement, or both are wrong.
1450
+
If the error is ignored, the offending coverpoint is retained (not excluded) or not, depending on the value of the
1451
+
.Iretain_unreachable_coverpoints_if_executed
1452
+
configuration parameter.
1453
+
See man
1454
+
.Blcovrc(5)
1455
+
and the
1456
+
.I"Exclusionmarkers"
1457
+
section of man
1458
+
.Bgeninfo(1)
1459
+
for more information.
1460
+
.PP
1461
+
1448
1462
.IPunsupported:3
1449
1463
the requested feature is not supported for this tool configuration. For example, function begin/end line range exclusions use some GCOV features that are not available in older GCC releases.
Copy file name to clipboardExpand all lines: man/lcovrc.5
+63Lines changed: 63 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -714,6 +714,24 @@ maximum during parallel processing.
714
714
#lcov_excl_stop = LCOV_EXCL_STOP
715
715
.br
716
716
717
+
.br
718
+
# override unreachable line default line exclusion regexp
719
+
.br
720
+
#lcov_unreachable_line = LCOV_UNREACHABLE_LINE
721
+
.br
722
+
.br
723
+
# override start of unreachable region regexp
724
+
.br
725
+
#lcov_unreachable_start = LCOV_UNREACHABLE_START
726
+
.br
727
+
728
+
.br
729
+
# override end of unreachable region regexp
730
+
.br
731
+
#lcov_unreachable_stop = LCOV_UNREACHABLE_STOP
732
+
.br
733
+
734
+
717
735
.br
718
736
# override start of branch exclude region regexp
719
737
.br
@@ -2551,6 +2569,37 @@ Specify the regexp used to mark the end of a region where exception-related bran
2551
2569
2552
2570
Default is 'LCOV_EXCL_EXECEPTION_BR_STOP'.
2553
2571
2572
+
.BR lcov_unreachable_line " ="
2573
+
.Iexpression
2574
+
.IP
2575
+
Specify the regular expression of unreachable line which should be excluded from reporting, but should generate an "inconsistent" error if hit.
2576
+
That is: we believe that the marked code is unreachable, so there is a bug in the code, the placement of the directive, or both if the "unreachable" code is executed.
2577
+
Line, branch, and function coverpoints are associated with lines where this regexp is found are dropped.
2578
+
.br
2579
+
2580
+
Default is 'LCOV_UNREACHABLE_LINE'.
2581
+
.PP
2582
+
2583
+
.BR lcov_unreachable_start " ="
2584
+
.IR expression
2585
+
.IP
2586
+
Specify the regexp mark the start of an unreachable code block.
2587
+
All coverpoints within exception regions are dropped, but the tool will generate
2588
+
an "inconsistent" error if any code in the block is executed.
2589
+
.br
2590
+
2591
+
Default is 'LCOV_UNREACHABLE_START'.
2592
+
2593
+
.PP
2594
+
2595
+
.BR lcov_unreachable_stop " ="
2596
+
.IR expression
2597
+
.IP
2598
+
Specify the regexp mark the end of the unreachable code block.
0 commit comments