Skip to content

Commit 9105349

Browse files
committed
By default, emit only first 'unmapped' error in each file.
Signed-off-by: Henry Cox <[email protected]>
1 parent 09cb646 commit 9105349

File tree

1 file changed

+35
-9
lines changed

1 file changed

+35
-9
lines changed

bin/genhtml

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4250,7 +4250,9 @@ sub _countBranchTlaData
42504250
$srcLine = $self->line($line);
42514251
if (!defined($srcLine)) {
42524252
lcovutil::ignorable_error($lcovutil::ERROR_UNMAPPED_LINE,
4253-
"no data for 'branch' line:$line, file:" . $self->path());
4253+
"no data for 'branch' line:$line, file:" . $self->path())
4254+
if (!$lcovutil::warn_once_per_file ||
4255+
lcovutil::warn_once($lcovutil::ERROR_UNMAPPED_LINE, $self->path()));
42544256
} else {
42554257
$srcLine->branchElem($differentialData);
42564258
if (@SourceFile::annotateScript &&
@@ -4390,7 +4392,10 @@ sub _countLineTlaData
43904392

43914393
if (!defined($l)) {
43924394
lcovutil::ignorable_error($lcovutil::ERROR_UNMAPPED_LINE,
4393-
"no data for line:$line, TLA:$tla, file:" . $self->path());
4395+
"no data for line:$line, TLA:$tla, file:" . $self->path())
4396+
if (!$lcovutil::warn_once_per_file ||
4397+
lcovutil::warn_once($lcovutil::ERROR_UNMAPPED_LINE,
4398+
$self->path()));
43944399
return;
43954400
}
43964401
# set the TLA of this line...
@@ -4722,7 +4727,10 @@ sub nextInDateBin
47224727
my $a = $self->line($line)->age();
47234728
if (!defined($a)) {
47244729
lcovutil::ignorable_error($lcovutil::ERROR_UNMAPPED_LINE,
4725-
"no age data for line:$line, file:" . $self->path());
4730+
"no age data for line:$line, file:" . $self->path())
4731+
if (!$lcovutil::warn_once_per_file ||
4732+
lcovutil::warn_once($lcovutil::ERROR_UNMAPPED_LINE,
4733+
$self->path()));
47264734
return undef;
47274735
}
47284736
last
@@ -4744,13 +4752,19 @@ sub nextInDateBin
47444752
my $l = $self->line($line);
47454753
if (!defined($l)) {
47464754
lcovutil::ignorable_error($lcovutil::ERROR_UNMAPPED_LINE,
4747-
"no data for line:$line, file:" . $self->path());
4755+
"no data for line:$line, file:" . $self->path())
4756+
if (!$lcovutil::warn_once_per_file ||
4757+
lcovutil::warn_once($lcovutil::ERROR_UNMAPPED_LINE,
4758+
$self->path()));
47484759
return undef;
47494760
}
47504761
my $a = $l->age();
47514762
if (!defined($a)) {
47524763
lcovutil::ignorable_error($lcovutil::ERROR_UNMAPPED_LINE,
4753-
"no age data for line:$line, file:" . $self->path());
4764+
"no age data for line:$line, file:" . $self->path())
4765+
if (!$lcovutil::warn_once_per_file ||
4766+
lcovutil::warn_once($lcovutil::ERROR_UNMAPPED_LINE,
4767+
$self->path()));
47544768
return undef;
47554769
}
47564770
my $bin = SummaryInfo::findAgeBin($a);
@@ -4791,14 +4805,20 @@ sub nextInOwnerBin
47914805
my $l = $self->line($line);
47924806
if (!defined($l)) {
47934807
lcovutil::ignorable_error($lcovutil::ERROR_UNMAPPED_LINE,
4794-
"no data for line:$line, file:" . $self->path());
4808+
"no data for line:$line, file:" . $self->path())
4809+
if (!$lcovutil::warn_once_per_file ||
4810+
lcovutil::warn_once($lcovutil::ERROR_UNMAPPED_LINE,
4811+
$self->path()));
47954812
return undef;
47964813
}
47974814
my $t = $l->tla();
47984815
my $o = $l->owner();
47994816
if (!defined($o)) {
48004817
lcovutil::ignorable_error($lcovutil::ERROR_UNMAPPED_LINE,
4801-
"no owber data for line:$line, file:" . $self->path());
4818+
"no owber data for line:$line, file:" . $self->path())
4819+
if (!$lcovutil::warn_once_per_file ||
4820+
lcovutil::warn_once($lcovutil::ERROR_UNMAPPED_LINE,
4821+
$self->path()));
48024822
return undef;
48034823
}
48044824
last
@@ -4843,13 +4863,19 @@ sub nextBranchInDateBin
48434863
my $l = $self->line($line);
48444864
if (!defined($l)) {
48454865
lcovutil::ignorable_error($lcovutil::ERROR_UNMAPPED_LINE,
4846-
"no data for line:$line, file:" . $self->path());
4866+
"no data for line:$line, file:" . $self->path())
4867+
if (!$lcovutil::warn_once_per_file ||
4868+
lcovutil::warn_once($lcovutil::ERROR_UNMAPPED_LINE,
4869+
$self->path()));
48474870
next;
48484871
}
48494872
my $a = $l->age();
48504873
if (!defined($a)) {
48514874
lcovutil::ignorable_error($lcovutil::ERROR_UNMAPPED_LINE,
4852-
"no age data for line:$line, file:" . $self->path());
4875+
"no age data for line:$line, file:" . $self->path())
4876+
if (!$lcovutil::warn_once_per_file ||
4877+
lcovutil::warn_once($lcovutil::ERROR_UNMAPPED_LINE,
4878+
$self->path()));
48534879
return undef;
48544880
}
48554881
my $bin = SummaryInfo::findAgeBin($a);

0 commit comments

Comments
 (0)