diff --git a/bin/genhtml b/bin/genhtml index ea0d5de..2e63dd7 100755 --- a/bin/genhtml +++ b/bin/genhtml @@ -973,7 +973,7 @@ sub append $record->branchCovCount($key, "age", $ageval)); } elsif ($covType == MCDC_DATA) { $self->mcdcCovCount($key, "age", $ageval, - $record->branchCovCount($key, "age", $ageval)); + $record->mcdcCovCount($key, "age", $ageval)); } else { $self->functionCovCount($key, 'age', $ageval, $record->functionCovCount($key, "age", $ageval)); @@ -4773,7 +4773,7 @@ sub _countMcdcTlaData $developer = $srcLine->owner(); if (defined($developer)) { - my $shash = $self->[BRANCH_OWNERS]; + my $shash = $self->[MCDC_OWNERS]; if (!exists($shash->{$developer})) { $shash->{$developer} = {}; $shash->{$developer}->{lines} = []; @@ -5822,7 +5822,7 @@ sub new # use 'current' count... my ($tla, $b_count, $c_count) = @{$expr->count($sense)}; - die("unexpected branch TLA $tla for count $c_count at " + die("unexpected MC/DC TLA $tla for count $c_count at " . $fileDetails->path() . ":$line") unless ( @@ -11719,8 +11719,17 @@ sub buildOwnerSummaryTable($$$$$$$$$$) my $first = 1; # owners are sorted from most uncovered lines to least foreach my $od (@$ownerList) { - my ($name, $lineData, $branchData) = @$od; - my $d = ($covType == SummaryInfo::LINE_DATA) ? $lineData : $branchData; + my ($name, $lineData, $branchData, $funcData, $mcdcData) = @$od; + my $d; + if ($covType == SummaryInfo::LINE_DATA) { + $d = $lineData; + } elsif ($covType == SummaryInfo::BRANCH_DATA) { + $d = $branchData; + } else { + die("unexpected type '$covType'") + unless ($covType == SummaryInfo::MCDC_DATA); + $d = $mcdcData; + } my ($missed, $found) = @$d; # only put user in table if they are responsible for at least one point @@ -12337,8 +12346,8 @@ END_OF_HTML if ($main::show_tla) { my @tlaRow = buildHeaderSummaryTableRow($summary, SummaryInfo::MCDC_DATA, - $fileDetail, \&SourceFile::nextBranchTlaGroup, - $tlaSummaryTypes); + $fileDetail, \&SourceFile::nextMcdcTlaGroup, + $tlaSummaryTypes); push(@dataRow, @tlaRow); } push(@row_right, \@dataRow) @@ -12457,7 +12466,7 @@ END_OF_HTML $summary, SummaryInfo::MCDC_DATA, $fileDetail, - \&SourceFile::nextBranchInOwnerBin, + \&SourceFile::nextMcdcInOwnerBin, "MC/DC coverage ownership bins", $ownerBinDetailPage, scalar(@dataRow), diff --git a/lib/lcovutil.pm b/lib/lcovutil.pm index 68baa16..a3f6c74 100644 --- a/lib/lcovutil.pm +++ b/lib/lcovutil.pm @@ -1709,7 +1709,7 @@ sub munge_file_patterns # sadly, substitutions aren't regexps and can't be precompiled if (@file_subst_patterns) { verify_regexp_patterns('--substitute', \@file_subst_patterns, - \$lcovutil::case_insensitive); + $lcovutil::case_insensitive); # keep track of number of times this was applied @file_subst_patterns = map({ [$_, 0]; } @file_subst_patterns); @@ -7558,8 +7558,6 @@ sub _filterFile return [$traceInfo, $modified]; } } - # @todo: if MCDC has just one expression, then drop it - - # it is equivalent to branch coverage. my $region = $cov_filter[$FILTER_EXCLUDE_REGION]; my $branch_region = $cov_filter[$FILTER_EXCLUDE_BRANCH]; my $range = $cov_filter[$lcovutil::FILTER_LINE_RANGE]; @@ -7818,6 +7816,7 @@ sub _filterFile next unless $branch && ($branch->totals())[0] == 2; $mcdc_count->remove($line); ++$mcdc_single->[-2]; # one MC/DC skipped + ++$mcdc_single->[-1]; # one coverpoint $mcdc->remove($line); # remove at top $modified = 1;