From: Daniel P. Berrange Date: Wed, 25 Jul 2007 23:18:15 +0000 (+0000) Subject: Ignore /usr/include in coverage reports X-Git-Tag: LIBVIRT_0_3_2~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf5000d9b0355748a2ba4a334002da36878364b7;p=thirdparty%2Flibvirt.git Ignore /usr/include in coverage reports --- diff --git a/ChangeLog b/ChangeLog index 909b6c9dc8..1c589bfeb3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -Tue Jul 25 19:13:43 EST 2007 Daniel P. berrange +Wed Jul 25 19:16:43 EST 2007 Daniel P. berrange + + * scripts/coverage-report.pl: Ignore data from inlined macros + in /usr/include files + +Wed Jul 25 19:13:43 EST 2007 Daniel P. berrange * src/nodeinfo.h, src/nodeinfo.c: Generic impl of virNodeGetInfo * src/qemu_driver.c, src/openvz_driver: Switch to generic impl diff --git a/scripts/coverage-report.pl b/scripts/coverage-report.pl index e67ecf9e74..1001aa4ad5 100644 --- a/scripts/coverage-report.pl +++ b/scripts/coverage-report.pl @@ -27,7 +27,18 @@ use warnings; use strict; -my %coverage = ( functions => {}, files => {} ); +my %coverage = ( function => {}, file => {} ); + +my @functionBlackList = ( + "__memcpy", + "__memmove", + "__memset", + "__strcat", + "__strcpy", + "__strncpy", + "__strsep", + "__strtok" + ); my %filemap; @@ -88,6 +99,12 @@ foreach my $type ("function", "file") { my $totalMiss = 0; my $count = 0; foreach my $func (keys %{$coverage{function}}) { + my $blacklisted = 0; + foreach my $blackName (@functionBlackList) { + $blacklisted = 1 if $func =~ /^$blackName/; + } + next if $blacklisted; + $count++; my $got = $coverage{function}->{$func}->{$m}; $totalGot += $got; @@ -110,6 +127,16 @@ print "\n"; foreach my $type ("function", "file") { printf "<%ss>\n", $type; foreach my $name (sort { $a cmp $b } keys %{$coverage{$type}}) { + if ($type eq "file") { + next if $name =~ m,^/usr,; + } else { + my $blacklisted = 0; + foreach my $blackName (@functionBlackList) { + $blacklisted = 1 if $name =~ /^$blackName/; + } + next if $blacklisted; + } + my $rec = $coverage{$type}->{$name}; printf " \n", $name, ($type eq "file" ? $filemap{$name} : $filemap{$rec->{file}}); printf " \n", $rec->{lines}, $rec->{linesCoverage};