Skip to content

Commit 0d8d2ad

Browse files
committed
Add 'callback' error category.
(Rerunning 'checksytle' also changed formating) Signed-off-by: Henry Cox <[email protected]>
1 parent e7cc583 commit 0d8d2ad

File tree

5 files changed

+51
-32
lines changed

5 files changed

+51
-32
lines changed

bin/genhtml

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ use lcovutil qw (set_tool_name define_errors parse_ignore_errors
103103
$ERROR_MISMATCH $ERROR_SOURCE $ERROR_BRANCH $ERROR_FORMAT
104104
$ERROR_EMPTY $ERROR_VERSION $ERROR_UNUSED $ERROR_PACKAGE
105105
$ERROR_CORRUPT $ERROR_NEGATIVE $ERROR_COUNT $ERROR_UNSUPPORTED
106-
$ERROR_DEPRECATED $ERROR_INCONSISTENT_DATA
106+
$ERROR_DEPRECATED $ERROR_INCONSISTENT_DATA $ERROR_CALLBACK
107107
$ERROR_PARALLEL report_parallel_error
108108
$br_coverage $func_coverage
109109
info $verbose init_verbose_flag debug $debug $devnull
@@ -223,7 +223,8 @@ $ERROR_CORRUPT = 14;
223223
$ERROR_NEGATIVE = 15;
224224
$ERROR_COUNT = 16;
225225
$ERROR_UNSUPPORTED = 17;
226-
$ERROR_DEPRECATED = 18;
226+
$ERROR_CALLBACK = 18;
227+
$ERROR_DEPRECATED = 19;
227228

228229
our %htmlErrs = ("source" => $ERROR_SOURCE,
229230
"unmapped" => $ERROR_UNMAPPED_LINE,
@@ -243,6 +244,7 @@ our %htmlErrs = ("source" => $ERROR_SOURCE,
243244
"count" => $ERROR_COUNT,
244245
"unsupported" => $ERROR_UNSUPPORTED,
245246
"deprecated" => $ERROR_DEPRECATED,
247+
"callback" => $ERROR_CALLBACK,
246248
"corrupt" => $ERROR_CORRUPT,);
247249
lcovutil::define_errors(\%htmlErrs);
248250

@@ -345,32 +347,32 @@ our %tlaLocation = ("UNC" => 1,
345347
"DUB" => 2,
346348
"DCB" => 2,);
347349

348-
our %tlaToTitle = ("UNC" => "Uncovered New Code (+ => 0):\n".
349-
"Newly added code is not tested",
350-
"LBC" => "Lost Baseline Coverage (1 => 0):\n".
351-
"Unchanged code is no longer tested",
352-
"UIC" => "Uncovered Included Code (# => 0):\n".
353-
"Previously unused code is untested",
354-
"UBC" => "Uncovered Baseline Code (0 => 0):\n".
355-
"Unchanged code was untested before, is untested now",
356-
357-
"GBC" => "Gained Baseline Coverage (0 => 1):\n".
358-
"Unchanged code is tested now",
359-
"GIC" => "Gained Included Coverage (# => 1):\n".
360-
"Previously unused code is tested now",
361-
"GNC" => "Gained New Coverage (+ => 1):\n".
362-
"Newly added code is tested",
363-
"CBC" => "Covered Baseline Code (1 => 1):\n".
364-
"Unchanged code was tested before and is still tested",
365-
366-
"EUB" => "Excluded Uncovered Baseline (0 => #):\n".
367-
"Previously untested code is unused now",
368-
"ECB" => "Excluded Covered Baseline (1 => #):\n".
369-
"Previously tested code is unused now",
370-
"DUB" => "Deleted Uncovered Baseline (0 => -):\n".
371-
"Previously untested code has been deleted",
372-
"DCB" => "Deleted Covered Baseline (1 => -):\n".
373-
"Previously tested code has been deleted",);
350+
our %tlaToTitle = ("UNC" => "Uncovered New Code (+ => 0):\n" .
351+
"Newly added code is not tested",
352+
"LBC" => "Lost Baseline Coverage (1 => 0):\n" .
353+
"Unchanged code is no longer tested",
354+
"UIC" => "Uncovered Included Code (# => 0):\n" .
355+
"Previously unused code is untested",
356+
"UBC" => "Uncovered Baseline Code (0 => 0):\n" .
357+
"Unchanged code was untested before, is untested now",
358+
359+
"GBC" => "Gained Baseline Coverage (0 => 1):\n" .
360+
"Unchanged code is tested now",
361+
"GIC" => "Gained Included Coverage (# => 1):\n" .
362+
"Previously unused code is tested now",
363+
"GNC" => "Gained New Coverage (+ => 1):\n" .
364+
"Newly added code is tested",
365+
"CBC" => "Covered Baseline Code (1 => 1):\n" .
366+
"Unchanged code was tested before and is still tested",
367+
368+
"EUB" => "Excluded Uncovered Baseline (0 => #):\n" .
369+
"Previously untested code is unused now",
370+
"ECB" => "Excluded Covered Baseline (1 => #):\n" .
371+
"Previously tested code is unused now",
372+
"DUB" => "Deleted Uncovered Baseline (0 => -):\n" .
373+
"Previously untested code has been deleted",
374+
"DCB" => "Deleted Covered Baseline (1 => -):\n" .
375+
"Previously tested code has been deleted",);
374376

375377
our %tlaToLegacy = ("UNC" => "Missed",
376378
"GNC" => "Hit",);
@@ -1167,7 +1169,8 @@ sub checkCoverageCriteria
11671169
$coverageCriteriaStatus = $status
11681170
if $status != 0;
11691171
} else {
1170-
print("Error: 'open(-| $cmd)' failed: \"$!\"\n");
1172+
lcovutil::ignorable_error($lcovutil::ERROR_CALLBACK,
1173+
"'open(-| $cmd)' failed: \"$!\"");
11711174
}
11721175
}
11731176

lib/lcovutil.pm

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ our @EXPORT_OK = qw($tool_name $tool_dir $lcov_version $lcov_url
6060
$ERROR_BRANCH $ERROR_EMPTY $ERROR_FORMAT $ERROR_VERSION $ERROR_UNUSED
6161
$ERROR_PACKAGE $ERROR_CORRUPT $ERROR_NEGATIVE $ERROR_COUNT
6262
$ERROR_UNSUPPORTED $ERROR_DEPRECATED $ERROR_INCONSISTENT_DATA
63+
$ERROR_CALLBACK
6364
$ERROR_PARALLEL report_parallel_error
6465
$stop_on_error
6566
@@ -110,7 +111,8 @@ our $ERROR_COUNT = 12; # too many messages of type
110111
our $ERROR_UNSUPPORTED = 13; # some unsupported feature or usage
111112
our $ERROR_PARALLEL = 14; # error in fork/join
112113
our $ERROR_DEPRECATED = 15; # deprecated feature
113-
our $ERROR_INCONSISTENT_DATA = 16; # somthing wrong with .info
114+
our $ERROR_CALLBACK = 16; # callback produced an error
115+
our $ERROR_INCONSISTENT_DATA = 17; # somthing wrong with .info
114116

115117
our %geninfoErrs = ("gcov" => $ERROR_GCOV,
116118
"source" => $ERROR_SOURCE,
@@ -128,6 +130,7 @@ our %geninfoErrs = ("gcov" => $ERROR_GCOV,
128130
"unsupported" => $ERROR_UNSUPPORTED,
129131
"inconsistent" => $ERROR_INCONSISTENT_DATA,
130132
"deprecated" => $ERROR_DEPRECATED,
133+
"callback" => $ERROR_CALLBACK,
131134
"package" => $ERROR_PACKAGE,);
132135
our $stop_on_error; # attempt to keep going
133136

@@ -1679,7 +1682,8 @@ sub extractFileVersion
16791682
0 == $status or
16801683
die("version-script '$cmd' returned non-zero exit code: '$!'");
16811684
} else {
1682-
die("unable to call open(| $cmd): $!");
1685+
lcovutil::ignorable_error($lcovutil::ERROR_CALLBACK,
1686+
"'open(-| $cmd)' failed: \"$!\"");
16831687
}
16841688
return $version;
16851689
}

man/genhtml.1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ ignore lines which contain only whitespace (or whitespace + comments) whose 'hit
15061506
Ignore line and branch coverpoints on lines which are out-of range/whose line number is beyond the end of the source file. These appear to be gcov artifacts caused by a macro instantiation on the last line of the file.
15071507

15081508
.B line:
1509-
alias for "\-\-ignore brace,blank".
1509+
alias for "\-\-filter brace,blank".
15101510

15111511
.B region:
15121512
apply LCOV_EXCL_START/LCOV_EXCL_STOP directives found in source text to the coverpoints found in the current and baseline .info files.
@@ -1948,6 +1948,10 @@ returned non\-zero exit status - likely a file path or related error. HTML sour
19481948
Branch ID (2nd field in the .info file 'BRDA' entry) does not follow expected integer sequence.
19491949
.br
19501950

1951+
.B callback:
1952+
Annotate, version, or criteria script error.
1953+
.br
1954+
19511955
.B category:
19521956
Line number categorizations are incorrect in the .info file, so branch coverage line number turns out to not be an executable source line.
19531957
.br

man/geninfo.1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,10 @@ can be a comma\-separated list of the following keywords:
690690
.B branch:
691691
branch ID (2nd field in the .info file 'BRDA' entry) does not follow expected integer sequence.
692692

693+
.B callback:
694+
Version script error.
695+
.br
696+
693697
.B corrupt:
694698
corrupt/unreadable file found.
695699

man/lcov.1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,10 @@ can be a comma\-separated list of the following keywords:
913913
.B branch:
914914
branch ID (2nd field in the .info file 'BRDA' entry) does not follow expected integer sequence.
915915

916+
.B callback:
917+
Version script error.
918+
.br
919+
916920
.B corrupt:
917921
corrupt/unreadable file found.
918922

0 commit comments

Comments
 (0)