@@ -3337,16 +3337,23 @@ sub check_path_consistency
3337
3337
# @todo could print line numbers in baseline, current .info files and
3338
3338
# in diff file ..
3339
3339
if (lcovutil::warn_once($lcovutil::ERROR_MISMATCH , $f )) {
3340
- lcovutil::ignorable_warning($lcovutil::ERROR_MISMATCH ,
3341
- " source file '$f ' (in $type .info file" .
3342
- ($missed {$f } == 3 ? " s" : " " ) .
3343
- " ) has same basename as 'diff' " .
3344
- ($single ? ' entry ' : " entries:\n\t " ) . " '" .
3345
- join (" '\n\t " , @unused ) .
3346
- " ' - but a different path." .
3347
- ($single ? " " : " \n\t " ) .
3348
- " Possible pathname mismatch? Perhaps see \" --elide-path-mismatch\" and/or \" --substitute\" options in 'man $lcovutil::tool_name '"
3349
- );
3340
+ my $suffix = lcovutil::explain_once(' elide-path-mismatch' ,
3341
+ ' Perhaps see "--elide-path-mismatch" and/or "--substitute" options in \' man '
3342
+ . $lcovutil::tool_name . ' \' ' );
3343
+ lcovutil::ignorable_warning(
3344
+ $lcovutil::ERROR_MISMATCH ,
3345
+ " source file '$f ' (in $type .info file" .
3346
+ ($missed {$f } == 3 ? " s" : " " ) .
3347
+ " ) has same basename as 'diff' "
3348
+ .
3349
+ ($single ? ' entry ' : " entries:\n\t "
3350
+ ) .
3351
+ " '" .
3352
+ join (" '\n\t " , @unused ) .
3353
+ " ' - but a different path." .
3354
+ ($single ? " " : " \n\t " ) .
3355
+ ' Possible pathname mismatch?' .
3356
+ $suffix );
3350
3357
}
3351
3358
if ($main::elide_path_mismatch &&
3352
3359
$missed {$f } == 3 &&
@@ -4670,8 +4677,6 @@ sub nextBranchInOwnerBin
4670
4677
return undef ;
4671
4678
}
4672
4679
4673
- my %annotateWarnings ; # warn only once per file
4674
-
4675
4680
sub _computeAge
4676
4681
{
4677
4682
my ($when , $path ) = @_ ;
@@ -4686,13 +4691,12 @@ sub _computeAge
4686
4691
DateTime-> now();
4687
4692
my $then = lcovutil::parse_w3cdtf($when );
4688
4693
if ($then > $now ) {
4689
- unless ( exists ( $annotateWarnings { $path } )) {
4694
+ if (lcovutil::warn_once( $lcovutil::ERROR_INCONSISTENT_DATA , $path )) {
4690
4695
# issue annotation warning at most once per file
4691
4696
my $data =
4692
4697
exists ($ENV {SOURCE_DATE_EPOCH }) ?
4693
4698
" 'SOURCE_DATE_EPOCH=$ENV {SOURCE_DATE_EPOCH}'" :
4694
4699
" 'now'" ;
4695
- $annotateWarnings {$path } = $now ;
4696
4700
lcovutil::ignorable_error($lcovutil::ERROR_INCONSISTENT_DATA ,
4697
4701
" File \" $path \" : $data ($now ) is older than annotate time '$when '"
4698
4702
);
@@ -4716,10 +4720,11 @@ sub _load
4716
4720
if (!defined ($repo_path )) {
4717
4721
if (!defined ($annotateCallback ) &&
4718
4722
!$main::synthesizeMissingFile ) {
4723
+ my $suffix =
4724
+ lcovutil::explain_once(' synthesize' ,
4725
+ ' (see --synthesize-missing option to work around)' );
4719
4726
lcovutil::ignorable_error($lcovutil::ERROR_SOURCE ,
4720
- " \" " . $self -> path() . " \" does not exist: $! " .
4721
- " (see --synthesize-missing option to work around)"
4722
- );
4727
+ " \" " . $self -> path() . " \" does not exist: $! " . $suffix );
4723
4728
}
4724
4729
$repo_path = $self -> path();
4725
4730
}
@@ -4733,9 +4738,13 @@ sub _load
4733
4738
lcovutil::checkVersionMatch($repo_path , $version ,
4734
4739
$currentVersion , ' load' );
4735
4740
} else {
4741
+ my $suffix = lcovutil::explain_once(' missingVersionMsg' ,
4742
+ " \n\t See the 'compute_file_version' section in man lcovrc(5)."
4743
+ );
4736
4744
lcovutil::ignorable_error($lcovutil::ERROR_VERSION ,
4737
4745
" '$repo_path ': computed '$version ' but version not defined in 'current' data file "
4738
- . $main::info_filenames [0]);
4746
+ . $main::info_filenames [0]
4747
+ . $suffix );
4739
4748
}
4740
4749
} elsif (defined ($currentVersion )) {
4741
4750
lcovutil::ignorable_error($lcovutil::ERROR_VERSION ,
@@ -5571,13 +5580,13 @@ sub merge_child($$$)
5571
5580
my $name =
5572
5581
$childSummary -> type() eq ' top' ? " " : $childSummary -> name();
5573
5582
$SummaryInfo::coverageCriteria {$name } = $criteria ;
5574
- $criteria -> [1] = 0 if $criteria -> [1] eq ' ' ;
5575
- my $v = $criteria -> [1];
5583
+ $criteria -> [1] = 0 if $criteria -> [1] eq ' ' ;
5584
+ my $v = $criteria -> [1];
5576
5585
die (' unexpected criteria data \' ' .
5577
5586
join (' ' , @$criteria ) . ' \' ' )
5578
5587
unless (Scalar::Util::looks_like_number($v ));
5579
- $SummaryInfo::coverageCriteriaStatus =
5580
- ($v != 0 || 0 != scalar (@{$criteria -> [2]})) ? $v : 0;
5588
+ $SummaryInfo::coverageCriteriaStatus =
5589
+ ($v != 0 || 0 != scalar (@{$criteria -> [2]})) ? $v : 0;
5581
5590
}
5582
5591
};
5583
5592
if ($@ ) {
@@ -6145,8 +6154,8 @@ if (0 == $exit_status && @SummaryInfo::coverageCriteriaScript) {
6145
6154
keys (%SummaryInfo::coverageCriteria ))
6146
6155
) {
6147
6156
my $criteria = $SummaryInfo::coverageCriteria {$name };
6148
- my $v = $criteria -> [1];
6149
- next if (!$v || $v == 0) && 0 == scalar (@{$criteria -> [2]}); # passed
6157
+ my $v = $criteria -> [1];
6158
+ next if (!$v || $v == 0) && 0 == scalar (@{$criteria -> [2]}); # passed
6150
6159
6151
6160
my $msg = $criteria -> [0];
6152
6161
if ($criteria -> [0] ne ' top' ) {
0 commit comments