summaryrefslogtreecommitdiff
path: root/mysql-test/dgcov.pl
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2021-08-02 10:11:41 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2021-08-02 10:11:41 +0200
commit6efb5e9f5e3cd3ec811ae832a67e1878c14f0dea (patch)
treeb7c1a18b8bbc638ee12951d1d04db6d21bebcaed /mysql-test/dgcov.pl
parent07674e6a741a82d2e30f9798f699209a6c34dfef (diff)
parentec8882b9ddbba2f9fc3571a1ac2ade0dabf412d9 (diff)
downloadmariadb-git-6efb5e9f5e3cd3ec811ae832a67e1878c14f0dea.tar.gz
Merge branch '10.5' into 10.6
Diffstat (limited to 'mysql-test/dgcov.pl')
-rwxr-xr-xmysql-test/dgcov.pl38
1 files changed, 20 insertions, 18 deletions
diff --git a/mysql-test/dgcov.pl b/mysql-test/dgcov.pl
index 525db191efa..639f3a5b72a 100755
--- a/mysql-test/dgcov.pl
+++ b/mysql-test/dgcov.pl
@@ -155,7 +155,7 @@ 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): $? $!";
@@ -167,25 +167,27 @@ sub gcov_one_file {
{
return;
}
- open FH, '<', "$gcov_file_path" or die "open(<$gcov_file_path): $!";
- my $fname;
- while (<FH>) {
- 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 '$_' after running '$cmd'";
- next;
+ for my $gcov_file (<$_*.gcov>) {
+ open FH, '<', "$gcov_file_path" or die "open(<$gcov_file_path): $!";
+ my $fname;
+ while (<FH>) {
+ chomp;
+ if (/^function:/) {
+ next;
+ }
+ if (/^file:/) {
+ $fname=realpath(-f $' ? $' : $root.$');
+ 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;
}
- $cov{$fname}->{$1}+=$2;
+ close(FH);
}
- close(FH);
}
sub write_coverage {