Commit 180b2bcd authored by Sergei Golubchik's avatar Sergei Golubchik

dgcov: also remove rpm dependency on IO::Uncompress::Gunzip

and enable option bundling
parent 7baf24a0
......@@ -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};
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment