From c622ce6fed61e07125c7d764f84fc70bb73c6c78 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Wed, 2 Jun 2010 06:25:40 +0000 Subject: tests: Redesigned test building; now all configurations of a single toolset are built in a single jam run git-svn-id: http://pugixml.googlecode.com/svn/trunk@493 99668b35-9821-0410-8761-19e4c4f06640 --- tests/autotest-local.pl | 78 +++++++++++++++++++++++++++++++++++------------- tests/autotest-report.pl | 25 +++++++++++----- tests/gcov-filter.pl | 10 +++++-- 3 files changed, 83 insertions(+), 30 deletions(-) (limited to 'tests') diff --git a/tests/autotest-local.pl b/tests/autotest-local.pl index 736c045..469221a 100644 --- a/tests/autotest-local.pl +++ b/tests/autotest-local.pl @@ -27,10 +27,12 @@ $fast = (shift eq 'fast'); @toolsets = ($^O =~ /MSWin/) ? (bcc, cw, dmc, ic8, ic9, ic9_x64, ic10, ic10_x64, ic11, ic11_x64, mingw34, mingw44, mingw45, mingw46_x64, msvc6, msvc7, msvc71, msvc8, msvc8_x64, msvc9, msvc9_x64, msvc10, msvc10_x64) : ($^O =~ /solaris/) ? (suncc) : (&gcctoolset()); @configurations = (debug, release); @defines = (PUGIXML_NO_XPATH, PUGIXML_NO_EXCEPTIONS, PUGIXML_NO_STL, PUGIXML_WCHAR_MODE); +$stddefine = 'PUGIXML_STANDARD'; if ($fast) { @defines = (PUGIXML_WCHAR_MODE); + @configurations = (debug); } @definesets = permute(@defines); @@ -41,35 +43,69 @@ print "### autotest begin " . scalar localtime() . "\n"; foreach $toolset (@toolsets) { - foreach $configuration (@configurations) + my $cmdline = "jam toolset=$toolset"; + + # add configurations + $cmdline .= " configuration=" . join(',', @configurations); + + # add definesets + $cmdline .= " defines=$stddefine"; + + foreach $defineset (@definesets) { - foreach $defineset (@definesets) + if ($defineset !~ /NO_XPATH/ && $defineset =~ /NO_EXCEPTIONS/) { next; } + if ($defineset !~ /NO_XPATH/ && $defineset =~ /NO_STL/) { next; } + + $cmdline .= ";$defineset" if ($defineset ne ''); + + # any configuration with prepare but without result is treated as failed + foreach $configuration (@configurations) { - if ($defineset !~ /NO_XPATH/ && $defineset =~ /NO_EXCEPTIONS/) { next; } - if ($defineset !~ /NO_XPATH/ && $defineset =~ /NO_STL/) { next; } + print "### autotest $Config{archname} $toolset $configuration [$defineset] prepare\n"; + } + } - print STDERR "*** testing $toolset/$configuration ($defineset) ... ***\n"; + print STDERR "*** testing $toolset... ***\n"; - # launch command - my $cmdline = "jam toolset=$toolset configuration=$configuration defines=$defineset"; - - print "### autotest launch $cmdline\n"; + # launch command + print "### autotest launch $cmdline\n"; - my $coverage = `$cmdline coverage`; - my $result = $? >> 8; + my $coverage = `$cmdline autotest=on coverage`; - # print build output - print $coverage; + # parse build output + foreach (split /\n/, $coverage) + { + ### autotest release [wchar] success + if (/^### autotest (\S+) \[(.*?)\] success/) + { + my $configuration = $1; + my $defineset = ($2 eq $stddefine) ? '' : $2; - # parse coverage - my $coverage_pugixml = $1 if ($coverage =~ /pugixml\.cpp' executed:([^%]+)%/); - my $coverage_pugixpath = $1 if ($coverage =~ /pugixpath\.cpp' executed:([^%]+)%/); - - # print build report - print "### autotest $Config{archname} $toolset $configuration [$defineset] result $result $coverage_pugixml $coverage_pugixpath\n"; + print "### autotest $Config{archname} $toolset $configuration [$defineset] success\n"; + } + ### autotest release [wchar] gcov + elsif (/^### autotest (\S+) \[(.*?)\] gcov/) + { + my $configuration = $1; + my $defineset = ($2 eq $stddefine) ? '' : $2; + my $file; + + $file = "pugixml $1" if (/pugixml\.cpp' executed:([^%]+)%/); + $file = "pugixpath $1" if (/pugixpath\.cpp' executed:([^%]+)%/); + + if (defined($file)) + { + print "### autotest $Config{archname} $toolset $configuration [$defineset] coverage $file\n"; + } + else + { + print "$_\n"; + } + } + else + { + print "$_\n"; } - - last if ($fast); } } diff --git a/tests/autotest-report.pl b/tests/autotest-report.pl index 71c840d..47fed38 100644 --- a/tests/autotest-report.pl +++ b/tests/autotest-report.pl @@ -58,18 +58,29 @@ sub insertindex while (<>) { ### autotest i386-freebsd-64int gcc release [wchar] result 0 97.78 98.85 - if (/^### autotest (\S+) (\S+) (\S+) \[(.*?)\] result (\S+) (\S*) (\S*)/) + if (/^### autotest (\S+) (\S+) (\S+) \[(.*?)\] (.*)/) { - my ($platform, $toolset, $configuration, $defineset, $result, $coverage_pugixml, $coverage_pugixpath) = ($1, $2, $3, $4, $5, $6, $7); - - die "Detected duplicate build information $_\n" if defined $results{"$toolset $platform"}{$configuration}{$defineset}; + my ($platform, $toolset, $configuration, $defineset, $info) = ($1, $2, $3, $4, $5); my $fulltool = &prettyplatform($platform) . ' ' . &prettytoolset($toolset); my $fullconf = "$configuration $defineset"; - $results{$fulltool}{$fullconf}{result} = $result; - $results{$fulltool}{$fullconf}{coverage_pugixml} = $coverage_pugixml; - $results{$fulltool}{$fullconf}{coverage_pugixpath} = $coverage_pugixpath; + if ($info =~ /^prepare/) + { + $results{$fulltool}{$fullconf}{result} = 1; + } + elsif ($info =~ /^success/) + { + $results{$fulltool}{$fullconf}{result} = 0; + } + elsif ($info =~ /^coverage (\S+) (\S+)/) + { + $results{$fulltool}{$fullconf}{"coverage_$1"} = $2; + } + else + { + print STDERR "Unrecognized autotest infoline $_"; + } &insertindex(\%toolsets, $fulltool); diff --git a/tests/gcov-filter.pl b/tests/gcov-filter.pl index 8a581d0..8cbccc5 100644 --- a/tests/gcov-filter.pl +++ b/tests/gcov-filter.pl @@ -1,7 +1,13 @@ #!/usr/bin/perl -$lines = join('', <>); +$prefix = join(' ', @ARGV); +$prefix .= ' ' if ($prefix ne ''); + +$lines = join('', ); $lines =~ s/File (.+)\nLines (.+)\n(.+\n)*\n/$1 $2\n/g; $lines =~ s/.+include\/c\+\+.+\n//g; -print $lines; +foreach $line (split /\n/, $lines) +{ + print "$prefix$line\n"; +} -- cgit v1.2.3