From fee8a3b07deea60a8d490e574c922f5b3fd0dcdf Mon Sep 17 00:00:00 2001 From: Henry Cox Date: Fri, 30 May 2025 19:01:10 -0400 Subject: [PATCH] BUGFIX: there may be no GDCA file - e.g., in 'initial' capture. Signed-off-by: Henry Cox --- bin/geninfo | 18 +++++++++++------- tests/bin/test_run | 10 ++++++++++ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/bin/geninfo b/bin/geninfo index bec7e00..f494885 100755 --- a/bin/geninfo +++ b/bin/geninfo @@ -812,7 +812,7 @@ sub new sub worklist { my $self = shift; - # we saved the mssages for the end... + # we saved the messages for the end... foreach my $msg (values %{$self->[2]}) { lcovutil::ignorable_error($msg->[0], $msg->[1]); } @@ -1323,12 +1323,16 @@ sub gen_info(@) my @worklist; my $serialChunk = [1, []]; my $chunk = [0, []]; # [isSerial, [fileList]] - foreach my $j (@$filelist) { - my $filename = $j->[0] . $lcovutil::dirseparator . $j->[1]; - if (grep({ $filename =~ $_ } @main::large_files)) { - lcovutil::info(1, "large file: $filename\n"); - push(@{$serialChunk->[1]}, $j); - next; + FILE: foreach my $j (@$filelist) { + my ($dir, $gcda, $gcno) = @$j; + foreach my $f ($gcda, $gcno) { + next unless defined($f); # might not be a GCDA file + my $filename = $dir . $lcovutil::dirseparator . $f; + if (grep({ $filename =~ $_ } @main::large_files)) { + lcovutil::info(1, "large file: $filename\n"); + push(@{$serialChunk->[1]}, $j); + next FILE; + } } push(@{$chunk->[1]}, $j); if (scalar(@{$chunk->[1]}) == $chunkSize) { diff --git a/tests/bin/test_run b/tests/bin/test_run index 6864fa1..7b35d95 100755 --- a/tests/bin/test_run +++ b/tests/bin/test_run @@ -94,6 +94,16 @@ if [ ! -z "$TIME" ] ; then rm -f "$TIMEFILE" fi +if [ 0 == $RC ] ; then + for str in uninitialized ; do + grep $str $LOGFILE + if [ 0 == $? ] ; then + echo "unexpected '$str' in '$LOGFILE' for $TESTNAME" + RC=1 + fi + done +fi + # Save last output line as reason in case of skip result LAST=$(tail -n 1 "$LOGFILE" | sed -e 's/^ //g')