summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-08-29 15:46:30 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-08-29 15:46:30 +0000
commit0dd0b4c496c69f47078de58a3c42939a885ddd6b (patch)
tree10736f2154c66ea66d95b47a06a444988b777ca8 /tests
parent0868f83deba4319db2f30f56ccdbc3401ce59f9a (diff)
tests: Introduced fullcoverage mode
git-svn-id: http://pugixml.googlecode.com/svn/trunk@688 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests')
-rw-r--r--tests/gcov-filter.pl23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/gcov-filter.pl b/tests/gcov-filter.pl
index c68aa1f..f0d2019 100644
--- a/tests/gcov-filter.pl
+++ b/tests/gcov-filter.pl
@@ -1,10 +1,33 @@
#!/usr/bin/perl
+sub funcinfo
+{
+ my ($name, $info) = @_;
+
+ return if ($info =~ /No executable lines/);
+
+ my $lines = ($info =~ /Lines executed:([^%]+)%/) ? $1 : 100;
+ my $calls = ($info =~ /Calls executed:([^%]+)%/) ? $1 : 100;
+ my $branches = ($info =~ /Branches executed:([^%]+)%/) ? $1 : 100;
+ my $taken = ($info =~ /Taken at least once:([^%]+)%/) ? $1 : 100;
+
+ return if ($lines == 100 && $calls == 100 && $branches == 100 && $taken == 100);
+
+ return "Function $name: L $lines, C $calls, B $branches, BT $taken\n";
+}
+
$prefix = join(' ', @ARGV);
$prefix .= ' ' if ($prefix ne '');
$lines = join('', <STDIN>);
+
+# merge file information
$lines =~ s/File (.+)\nLines (.+)\n(.+\n)*\n/$1 $2\n/g;
+
+# merge function information
+$lines =~ s/Function (.+)\n((.+\n)*)\n/funcinfo($1, $2)/eg;
+
+# remove include information
$lines =~ s/.+include\/c\+\+.+\n//g;
foreach $line (split /\n/, $lines)