Skip to content

Commit 6141622

Browse files
committed
Bugfix: per-testcase categorization of branch coverpoints.
Signed-off-by: Henry Cox <[email protected]>
1 parent 1789981 commit 6141622

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

bin/genhtml

+10-6
Original file line numberDiff line numberDiff line change
@@ -4036,10 +4036,11 @@ sub _countBranchTlaData
40364036
my %foundBranchTlas;
40374037
my ($src_age, $developer, $srcLine);
40384038
my $lineTla = $lineData->tla();
4039+
$srcLine = $self->line($line);
4040+
$srcLine->branchElem($differentialData);
40394041
if (@SourceFile::annotateScript &&
40404042
!grep(/^$lineTla$/, ('DUB', 'DCB'))) {
40414043
# deleted lines don't have owner data...
4042-
$srcLine = $self->line($line);
40434044
if (!defined($srcLine)) {
40444045
lcovutil::ignorable_error($lcovutil::ERROR_UNMAPPED_LINE,
40454046
"no data for 'branch' line:$line, file:" . $self->path());
@@ -4048,7 +4049,6 @@ sub _countBranchTlaData
40484049
# library - then we might not have file history for it.
40494050
$src_age = $srcLine->age();
40504051
$developer = $srcLine->owner();
4051-
$srcLine->branchElem($differentialData);
40524052

40534053
if (defined($developer)) {
40544054
my $shash = $self->[BRANCH_OWNERS];
@@ -4081,8 +4081,8 @@ sub _countBranchTlaData
40814081
$foundBranchTlas{$tla} = 1;
40824082
$self->[BRANCH_CATEGORIES]->{$tla} = []
40834083
unless exists($self->[BRANCH_CATEGORIES]->{$tla});
4084-
push(@{$self->[BRANCH_CATEGORIES]->{$tla}}, $line);
40854084
}
4085+
push(@{$self->[BRANCH_CATEGORIES]->{$tla}}, $line);
40864086

40874087
next
40884088
if (0 == ($SummaryInfo::tlaLocation{$tla} & 0x1));
@@ -4092,7 +4092,11 @@ sub _countBranchTlaData
40924092
# and the age...
40934093
#lcovutil::info("$l: $tla" . $lineData->in_curr() . "\n");
40944094

4095-
next unless defined($srcLine) && defined($src_age);
4095+
unless (defined($srcLine) && defined($src_age)) {
4096+
# just count totals
4097+
$fileSummary->branchCovCount($tla, 'noGroup', undef, 1);
4098+
next;
4099+
}
40964100

40974101
# increment count of branches of this age we found for this TLA
40984102
$fileSummary->branchCovCount($tla, "age", $src_age, 1);
@@ -9364,8 +9368,8 @@ sub write_source_line(*$$$$)
93649368
# '$result' is used to generate the PNG frame
93659369
info(2,
93669370
" $bucket: line=$line " .
9367-
(defined($count) ? "count= $count " : "") . 'curr=' .
9368-
(defined($curr_count) ? $curr_count : '-') . 'base=' .
9371+
(defined($count) ? "count= $count " : "") . ' curr=' .
9372+
(defined($curr_count) ? $curr_count : '-') . ' base=' .
93699373
(defined($base_count) ? $base_count : '-') . "\n");
93709374
}
93719375
$result .= ":" . $source;

0 commit comments

Comments
 (0)