Skip to content

Commit 398d2a0

Browse files
committed
Clarify genhtml table compression effects (add footnote to table when
rows are elided). Signed-off-by: Henry Cox <[email protected]>
1 parent 0c3afea commit 398d2a0

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

bin/genhtml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,6 +1697,7 @@ sub findFileList
16971697
my $dirSummary = $self->[1];
16981698
my $owner = $self->[0];
16991699
my @files;
1700+
my $skipped = 0;
17001701
foreach my $file ($dirSummary->sources()) {
17011702
my $source = $dirSummary->get_source($file);
17021703
next unless $source->contains_owner($owner);
@@ -1727,7 +1728,8 @@ sub findFileList
17271728
if ($all ||
17281729
0 != $missed ||
17291730
0 != $br_missed ||
1730-
0 != $fn_missed) {
1731+
0 != $fn_missed ||
1732+
0 != $mcdc_missed) {
17311733

17321734
push(@files,
17331735
[$file,
@@ -1736,9 +1738,11 @@ sub findFileList
17361738
[$mcdc_missed, $mcdc_total, $mcdcCb],
17371739
[$fn_missed, $fn_total, $funcCb]
17381740
]);
1741+
} else {
1742+
++$skipped;
17391743
}
17401744
}
1741-
return @files;
1745+
return [$skipped, @files];
17421746
}
17431747

17441748
sub secondaryElementFileData
@@ -1831,6 +1835,7 @@ sub findFileList
18311835
my $dirSummary = $self->[2];
18321836
my $ageval = $self->[1];
18331837
my @files;
1838+
my $skipped = 0;
18341839
foreach my $file ($dirSummary->sources()) {
18351840
my $source = $dirSummary->get_source($file);
18361841

@@ -1869,9 +1874,11 @@ sub findFileList
18691874
[$mcdc_missed, $mcdc_total, $mcdcCb],
18701875
[$fn_missed, $fn_total, $funcCb]
18711876
]);
1877+
} else {
1878+
++$skipped;
18721879
}
18731880
}
1874-
return @files;
1881+
return [$skipped, @files];
18751882
}
18761883

18771884
sub secondaryElementFileData
@@ -12819,6 +12826,7 @@ sub write_file_table(*$$$$$$)
1281912826
# rows that the $primary cell will span
1282012827

1282112828
my @secondaryRows;
12829+
my $skippedSecondaryRows = 0;
1282212830

1282312831
if (defined($showBinDetail)) {
1282412832

@@ -12901,7 +12909,8 @@ sub write_file_table(*$$$$$$)
1290112909
}
1290212910
} # if showBinDetail
1290312911
elsif ($primary_key ne 'name') {
12904-
push(@secondaryRows, $primaryCb->findFileList($all));
12912+
($skippedSecondaryRows, @secondaryRows) =
12913+
@{$primaryCb->findFileList($all)};
1290512914
}
1290612915

1290712916
my ($found, $hit, $fn_found, $fn_hit,
@@ -12965,16 +12974,16 @@ sub write_file_table(*$$$$$$)
1296512974
$cbStruct, SummaryInfo::FUNCTION_DATA
1296612975
]);
1296712976
}
12968-
my $elide_secondary_header =
12969-
$compactSummaryTables && (scalar(@secondaryRows) == 1);
12977+
my $elide_secondary_header = $compactSummaryTables &&
12978+
(scalar(@secondaryRows) == 1 && $skippedSecondaryRows == 0);
1297012979
$suppressedSecondaryHeader ||= $elide_secondary_header;
1297112980
if (!$elide_secondary_header) {
1297212981
# pass 'dirSummary' to print method: we omit the 'owner' column if
1297312982
# none of the files in this directory have any owner information
1297412983
# (i.e., none of them are found in the repo)
1297512984
my $numRows = (1 + scalar(@secondaryRows));
1297612985
my $asterisk;
12977-
if ($elideEmptyRows && 1 == $numRows) {
12986+
if ($elideEmptyRows && (1 == $numRows || $skippedSecondaryRows)) {
1297812987
$asterisk = '&lowast;';
1297912988
$suppressedEmptyRow = 1;
1298012989
}
@@ -13064,6 +13073,7 @@ sub write_file_table(*$$$$$$)
1306413073
# no information by eliding the directory part
1306513074
$name = File::Basename::basename($name);
1306613075
}
13076+
$name = apply_prefix($name, @dir_prefix);
1306713077
write_file_table_entry(*HTML_HANDLE, $base_dir,
1306813078
# 'owner' page type - no span, no page link
1306913079
[$name,
@@ -13168,7 +13178,7 @@ sub write_file_table(*$$$$$$)
1316813178
}
1316913179
foreach my $note (
1317013180
[ $suppressedEmptyRow,
13171-
"<sup>&lowast;</sup> 'Detail' entries with no 'missed' coverpoints are elided."
13181+
"<sup>&lowast;</sup> 'Detail' entries with no 'missed' coverpoints are elided. Use the '--show-owners all' flag to retain them."
1317213182
],
1317313183
[ $suppressedSecondaryHeader,
1317413184
'<sup>&lowast;&lowast;</sup> Bin \'Total\' header elided when bin contains only one entry.'

0 commit comments

Comments
 (0)