diff --git a/mysql-test/dgcov.pl b/mysql-test/dgcov.pl index 4adafd552fa..c05c4211caa 100755 --- a/mysql-test/dgcov.pl +++ b/mysql-test/dgcov.pl @@ -36,6 +36,7 @@ my $opt_skip_gcov; my %cov; my $file_no=0; +Getopt::Long::Configure ("bundling"); GetOptions ("v|verbose+" => \$opt_verbose, "h|help" => \$opt_help, @@ -188,17 +189,16 @@ sub gcov_one_file { close(FH); } } else { - use IO::Uncompress::Gunzip qw(gunzip $GunzipError); + require IO::Uncompress::Gunzip; require JSON::PP; my $gcov_file_json; - my $fname; s/\.gcda$// if $gcc_version >= 11; - gunzip "$_.gcov.json.gz" => \$gcov_file_json or die "gunzip($_.gcov.json.gz): $GunzipError"; + IO::Uncompress::Gunzip::gunzip("$_.gcov.json.gz", \$gcov_file_json) + or die "gunzip($_.gcov.json.gz): $IO::Uncompress::Gunzip::GunzipError"; my $obj= JSON::PP::decode_json $gcov_file_json; for my $file (@{$obj->{files}}) { - $fname= $file->{file}; for my $line (@{$file->{lines}}){ - $cov{$fname}->{$line->{line_number}}+= $line->{count}; + $cov{$file->{file}}->{$line->{line_number}}+= $line->{count}; } } }