Ignore /usr/include in coverage reports

This commit is contained in:
Daniel P. Berrange 2007-07-25 23:18:15 +00:00
parent 773aa3b86b
commit cf5000d9b0
2 changed files with 34 additions and 2 deletions

View File

@ -1,4 +1,9 @@
Tue Jul 25 19:13:43 EST 2007 Daniel P. berrange <berrange@redhat.com>
Wed Jul 25 19:16:43 EST 2007 Daniel P. berrange <berrange@redhat.com>
* scripts/coverage-report.pl: Ignore data from inlined macros
in /usr/include files
Wed Jul 25 19:13:43 EST 2007 Daniel P. berrange <berrange@redhat.com>
* src/nodeinfo.h, src/nodeinfo.c: Generic impl of virNodeGetInfo
* src/qemu_driver.c, src/openvz_driver: Switch to generic impl

View File

@ -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 "<coverage>\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 " <entry name=\"%s\" details=\"%s\">\n", $name, ($type eq "file" ? $filemap{$name} : $filemap{$rec->{file}});
printf " <lines count=\"%s\" coverage=\"%s\"/>\n", $rec->{lines}, $rec->{linesCoverage};