Commit a59dffb0 authored by Anel Husakovic's avatar Anel Husakovic Committed by Anel

dgcov: parsing without dot to get specific version

- Regression introduced 7baf24a0 for multidigit gcc dump.
There is no dot in `dumpversion`.
```
$ gcc -dumpversion
10
```
Otherwise it will fail and not produce the output
```
Running dgcov
Name "IO::Uncompress::Gunzip::GunzipError" used only once: possible typo at ./dgcov.pl line 197.
Cannot parse gcc -dumpversion: 9
```

- The warning `once` is always generated:
```
Running dgcov
Name "IO::Uncompress::Gunzip::GunzipError" used only once: possible typo at ./dgcov.pl line 197.
<number>
```
Suppresing the line `Name "IO::Uncompress::Gunzip::GunzipError" used only once: possible typo at ./dgcov.pl line 197.`
with the patch.

- Reviewed by: <>
parent 180b2bcd
...@@ -71,7 +71,7 @@ if ($opt_purge) ...@@ -71,7 +71,7 @@ if ($opt_purge)
} }
my $gcc_version= `gcc -dumpversion`; my $gcc_version= `gcc -dumpversion`;
$gcc_version=~ s/^(\d+)\..*$/$1/ or die "Cannot parse gcc -dumpversion: $gcc_version"; $gcc_version=~ s/^(\d+).*$/$1/ or die "Cannot parse gcc -dumpversion: $gcc_version";
find(\&gcov_one_file, $root); find(\&gcov_one_file, $root);
find(\&write_coverage, $root) if $opt_generate; find(\&write_coverage, $root) if $opt_generate;
...@@ -191,6 +191,7 @@ sub gcov_one_file { ...@@ -191,6 +191,7 @@ sub gcov_one_file {
} else { } else {
require IO::Uncompress::Gunzip; require IO::Uncompress::Gunzip;
require JSON::PP; require JSON::PP;
no warnings 'once';
my $gcov_file_json; my $gcov_file_json;
s/\.gcda$// if $gcc_version >= 11; s/\.gcda$// if $gcc_version >= 11;
IO::Uncompress::Gunzip::gunzip("$_.gcov.json.gz", \$gcov_file_json) IO::Uncompress::Gunzip::gunzip("$_.gcov.json.gz", \$gcov_file_json)
......
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