tests: Introduced fullcoverage mode
git-svn-id: http://pugixml.googlecode.com/svn/trunk@688 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
parent
0868f83deb
commit
0dd0b4c496
10
Jamfile.jam
10
Jamfile.jam
@ -43,7 +43,15 @@ if ( $(toolset:I=^mingw) || $(toolset:I=^gcc) )
|
|||||||
{
|
{
|
||||||
CCFLAGS = -fprofile-arcs -ftest-coverage ;
|
CCFLAGS = -fprofile-arcs -ftest-coverage ;
|
||||||
LDFLAGS = -fprofile-arcs ;
|
LDFLAGS = -fprofile-arcs ;
|
||||||
GCOVFLAGS = -n ;
|
|
||||||
|
if $(fullcoverage)
|
||||||
|
{
|
||||||
|
GCOVFLAGS = --branch-probabilities --function-summaries ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GCOVFLAGS = --no-output ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# build folder
|
# build folder
|
||||||
|
|||||||
@ -1,10 +1,33 @@
|
|||||||
#!/usr/bin/perl
|
#!/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 = join(' ', @ARGV);
|
||||||
$prefix .= ' ' if ($prefix ne '');
|
$prefix .= ' ' if ($prefix ne '');
|
||||||
|
|
||||||
$lines = join('', <STDIN>);
|
$lines = join('', <STDIN>);
|
||||||
|
|
||||||
|
# merge file information
|
||||||
$lines =~ s/File (.+)\nLines (.+)\n(.+\n)*\n/$1 $2\n/g;
|
$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;
|
$lines =~ s/.+include\/c\+\+.+\n//g;
|
||||||
|
|
||||||
foreach $line (split /\n/, $lines)
|
foreach $line (split /\n/, $lines)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user