Skip to content

Commit

Permalink
Bugfix: per-testcase categorization of branch coverpoints.
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Cox <[email protected]>
  • Loading branch information
henry2cox committed Apr 10, 2024
1 parent 1789981 commit 6141622
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions bin/genhtml
Original file line number Diff line number Diff line change
Expand Up @@ -4036,10 +4036,11 @@ sub _countBranchTlaData
my %foundBranchTlas;
my ($src_age, $developer, $srcLine);
my $lineTla = $lineData->tla();
$srcLine = $self->line($line);
$srcLine->branchElem($differentialData);
if (@SourceFile::annotateScript &&
!grep(/^$lineTla$/, ('DUB', 'DCB'))) {
# deleted lines don't have owner data...
$srcLine = $self->line($line);
if (!defined($srcLine)) {
lcovutil::ignorable_error($lcovutil::ERROR_UNMAPPED_LINE,
"no data for 'branch' line:$line, file:" . $self->path());
Expand All @@ -4048,7 +4049,6 @@ sub _countBranchTlaData
# library - then we might not have file history for it.
$src_age = $srcLine->age();
$developer = $srcLine->owner();
$srcLine->branchElem($differentialData);

if (defined($developer)) {
my $shash = $self->[BRANCH_OWNERS];
Expand Down Expand Up @@ -4081,8 +4081,8 @@ sub _countBranchTlaData
$foundBranchTlas{$tla} = 1;
$self->[BRANCH_CATEGORIES]->{$tla} = []
unless exists($self->[BRANCH_CATEGORIES]->{$tla});
push(@{$self->[BRANCH_CATEGORIES]->{$tla}}, $line);
}
push(@{$self->[BRANCH_CATEGORIES]->{$tla}}, $line);

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

next unless defined($srcLine) && defined($src_age);
unless (defined($srcLine) && defined($src_age)) {
# just count totals
$fileSummary->branchCovCount($tla, 'noGroup', undef, 1);
next;
}

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

0 comments on commit 6141622

Please sign in to comment.