Skip to content

Commit 3910185

Browse files
committed
BUGFIX: there may be no GDCA file - e.g., in 'initial' capture.
Signed-off-by: Henry Cox <[email protected]>
1 parent 661512b commit 3910185

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

bin/geninfo

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ sub new
812812
sub worklist
813813
{
814814
my $self = shift;
815-
# we saved the mssages for the end...
815+
# we saved the messages for the end...
816816
foreach my $msg (values %{$self->[2]}) {
817817
lcovutil::ignorable_error($msg->[0], $msg->[1]);
818818
}
@@ -1323,12 +1323,16 @@ sub gen_info(@)
13231323
my @worklist;
13241324
my $serialChunk = [1, []];
13251325
my $chunk = [0, []]; # [isSerial, [fileList]]
1326-
foreach my $j (@$filelist) {
1327-
my $filename = $j->[0] . $lcovutil::dirseparator . $j->[1];
1328-
if (grep({ $filename =~ $_ } @main::large_files)) {
1329-
lcovutil::info(1, "large file: $filename\n");
1330-
push(@{$serialChunk->[1]}, $j);
1331-
next;
1326+
FILE: foreach my $j (@$filelist) {
1327+
my ($dir, $gcda, $gcno) = @$j;
1328+
foreach my $f ($gcda, $gcno) {
1329+
next unless defined($f); # might not be a GCDA file
1330+
my $filename = $dir . $lcovutil::dirseparator . $f;
1331+
if (grep({ $filename =~ $_ } @main::large_files)) {
1332+
lcovutil::info(1, "large file: $filename\n");
1333+
push(@{$serialChunk->[1]}, $j);
1334+
next FILE;
1335+
}
13321336
}
13331337
push(@{$chunk->[1]}, $j);
13341338
if (scalar(@{$chunk->[1]}) == $chunkSize) {

tests/bin/test_run

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,16 @@ if [ ! -z "$TIME" ] ; then
9494
rm -f "$TIMEFILE"
9595
fi
9696

97+
if [ 0 == $RC ] ; then
98+
for str in uninitialized ; do
99+
grep $str $LOGFILE
100+
if [ 0 == $? ] ; then
101+
echo "unexpected '$str' in '$LOGFILE' for $TESTNAME"
102+
RC=1
103+
fi
104+
done
105+
fi
106+
97107
# Save last output line as reason in case of skip result
98108
LAST=$(tail -n 1 "$LOGFILE" | sed -e 's/^ //g')
99109

0 commit comments

Comments
 (0)