tools/winetest dissect
Jeremy Newman
jnewman at wine.codeweavers.com
Thu Mar 1 12:30:28 CST 2007
ChangeSet ID: 30939
CVSROOT: /opt/cvs-commit
Module name: tools
Changes by: jnewman at winehq.org 2007/03/01 12:30:28
Modified files:
winetest : dissect
Log message:
Paul Vriens <paul.vriens.wine at gmail.com>
Cater for multiple 'tests executed' lines
Patch: http://cvs.winehq.org/patch.py?id=30939
Old revision New revision Changes Path
1.20 1.21 +23 -10 tools/winetest/dissect
Index: tools/winetest/dissect
diff -u -p tools/winetest/dissect:1.20 tools/winetest/dissect:1.21
--- tools/winetest/dissect:1.20 1 Mar 2007 18:30:28 -0000
+++ tools/winetest/dissect 1 Mar 2007 18:30:28 -0000
@@ -143,7 +143,10 @@ if ($wine) {
/Test output:\r?/ or mydie "no test header: $_";
my ($unit, $test, $source, $rev, $result);
+my ($lines,$total, $todo, $failed);
$unit = undef; # state machine starts
+$total = $todo = $failed = 0;
+$lines = 0;
while (<IN>) {
if (!defined $unit) { # new test
next if /^\s*$/;
@@ -151,17 +154,25 @@ while (<IN>) {
or mydie "no start line:$.: $_";
($unit,$test,$source,$rev) = ($1,$2,$3,$4);
open OUT, ">:raw", $tmpfile or mydie "can't open $tmpfile: $!\n";
+ } elsif (s/^(.*$test.*: (\d+) tests executed, (\d+) marked as todo, (\d+) failures?\.)\r?$/$1/) {
+ $lines++;
+ $total += $2;
+ $todo += $3;
+ $failed += $4;
+ print OUT;
+ } elsif (s/^(.*$test.*: (\d+) tests executed \((\d+) marked as todo, (\d+) failures?\), (\d+) skipped\.)\r?$/$1/) {
+ $lines++;
+ $total += $2;
+ $todo += $3;
+ $failed += $4;
+ print OUT;
} elsif (s/$unit:$test done \((-?\d+)\)\r?$//) {
- chomp; # current test failed
- $result = "failed $1 -";
- goto FINISH;
- } elsif (s/^($test: (\d+) tests executed, (\d+) marked as todo, (\d+) failures?\.)\r?$/$1/) {
- <IN>; # current test finished
- $result = "$2 $3 $4";
- goto FINISH;
- } elsif (s/^($test: (\d+) tests executed \((\d+) marked as todo, (\d+) failures?\), (\d+) skipped\.)\r?$/$1/) {
- <IN>; # current test finished
- $result = "$2 $3 $4";
+ chomp; # current test ended
+ if ($lines==0) {
+ $result = "failed $1 -";
+ } else {
+ $result = "$total $todo $failed";
+ }
FINISH:
print SUM "- $unit $test $result $source $rev\n";
print OUT;
@@ -172,6 +183,8 @@ while (<IN>) {
mydie "can't rename $tmpfile to $testfile: $!\n";
}
$unit = undef;
+ $total = $todo = $failed = 0;
+ $lines = 0;
} else { # current test output
print OUT;
}
More information about the wine-cvs
mailing list