diff --git a/mysql-test/dgcov.pl b/mysql-test/dgcov.pl index fbc5540e697..734f5c6ed7d 100755 --- a/mysql-test/dgcov.pl +++ b/mysql-test/dgcov.pl @@ -155,32 +155,34 @@ END sub gcov_one_file { return unless /\.gcda$/; unless ($opt_skip_gcov) { - $cmd= "gcov -i '$_' 2>/dev/null >/dev/null"; + $cmd= "gcov -il '$_' 2>/dev/null >/dev/null"; print STDERR ++$file_no,"\r" if not $opt_verbose and -t STDERR; logv "Running: $cmd"; system($cmd)==0 or die "system($cmd): $? $!"; } # now, read the generated file - open FH, '<', "$_.gcov" or die "open(<$_.gcov): $!"; - my $fname; - while () { - chomp; - if (/^function:/) { - next; + for my $gcov_file (<$_*.gcov>) { + open FH, '<', "$gcov_file" or die "open(<$gcov_file): $!"; + my $fname; + while () { + chomp; + if (/^function:/) { + next; + } + if (/^file:/) { + $fname=realpath($'); + next; + } + next if /^lcount:\d+,-\d+/; # whatever that means + unless (/^lcount:(\d+),(\d+)/ and $fname) { + warn "unknown line '$_' in $gcov_file"; + next; + } + $cov{$fname}->{$1}+=$2; } - if (/^file:/) { - $fname=realpath($'); - next; - } - next if /^lcount:\d+,-\d+/; # whatever that means - unless (/^lcount:(\d+),(\d+)/ and $fname) { - warn "unknown line '$_' after running '$cmd'"; - next; - } - $cov{$fname}->{$1}+=$2; + close(FH); } - close(FH); } sub write_coverage {