Module: tools Branch: master Commit: 76d99803791cd5527ca2beca2f77589616ca4a1f URL: http://source.winehq.org/git/tools.git/?a=commit;h=76d99803791cd5527ca2beca2...
Author: Alexandre Julliard julliard@winehq.org Date: Fri Dec 10 17:40:57 2010 +0100
winetest: Add support for tests skipped by the user.
---
winetest/dissect | 18 ++++++++++++++++-- winetest/gather | 28 ++++++++++++++++++++++------ 2 files changed, 38 insertions(+), 8 deletions(-)
diff --git a/winetest/dissect b/winetest/dissect index 00edcc5..9dd1903 100755 --- a/winetest/dissect +++ b/winetest/dissect @@ -233,6 +233,10 @@ while ($_ = <IN>) { { print SUM "- $module - missing - - - - -\n"; } + elsif ($2 eq "skipped") + { + print SUM "- $module - skipped - - - - -\n"; + } }
/^Test output:/ or mydie "no test header: $_"; @@ -245,14 +249,20 @@ my $testbox; while (<IN>) { if (!defined $dll) { # new test next if /^\s*$/; - m[([_.a-z0-9]+):([_a-z0-9]+) start ([/_.a-z0-9]+) (-|[.0-9a-f]+)\r?$] + m[([_.a-z0-9]+):([_a-z0-9]+) (start|skipped) ([/_.a-z0-9]+) (-|[.0-9a-f]+)\r?$] or next; - ($dll,$unit,$source,$rev) = ($1,$2,$3,$4); + ($dll,$unit,$source,$rev) = ($1,$2,$4,$5); $testbox = create_box( "$dll:$unit", "testfile", "<a href="$gitweb/?a=history;f=$source;hb=$testbuild">$source</a>" ); if (defined($dllinfo{$dll}->{version}) && !defined($dllinfo{$dll}->{first})) { $dllinfo{$dll}->{first} = "$dll:$unit"; } + if ($3 eq "skipped") + { + $testbox->{data} .= sprintf "<div class="test result skipped">Skipped by user request.</div>\n"; + print SUM "- $dll $unit skipped - - - $source $rev\n"; + $dll = undef; + } } elsif (/^(.*$unit.*: (\d+) tests executed ((\d+) marked as todo, (\d+) failures?), (\d+) skipped.)\r?$/) { $lines++; $total += $2; @@ -320,6 +330,10 @@ foreach my $dll (sort keys %dllinfo) { $box->{data} .= sprintf "<tr><td>%s</td><td class="skipped">missing</td></tr>\n", escapeHTML($dll); } + elsif ($dllinfo{$dll}->{version} eq "skipped") + { + $box->{data} .= sprintf "<tr><td>%s</td><td class="skipped">skipped by user request</td></tr>\n", escapeHTML($dll); + } elsif ($dllinfo{$dll}->{version} eq "load error 1157") { $box->{data} .= sprintf "<tr><td>%s</td><td class="skipped">missing dependencies</td></tr>\n", escapeHTML($dll); diff --git a/winetest/gather b/winetest/gather index 6cfc954..ccce11c 100755 --- a/winetest/gather +++ b/winetest/gather @@ -144,7 +144,12 @@ foreach my $file (glob "$datadir/$build/*/summary.txt") {
if ($count eq "missing") { - $report->{dllmissing}->{$dll} = 1; + $report->{dllmissing}->{$dll} = "dll missing"; + next; + } + if ($unit eq "-" and $count eq "skipped") + { + $report->{dllmissing}->{$dll} = "skipped"; next; }
@@ -160,6 +165,11 @@ foreach my $file (glob "$datadir/$build/*/summary.txt") { } else { $report->{$testname} = { status => $todos }; } + } elsif ($count eq "skipped") { + $report->{$testname} = { status => "skipped", + count => [ 1, 1 ], + skips => [ 1, 1 ] + }; } else { $report->{$testname} = { status => "run", count => [ $count, $count ], @@ -199,11 +209,11 @@ sub merge_status($$) my ($group_result, $result) = @_; if (!defined $group_result->{status}) { $group_result->{status} = $result->{status}; - } elsif ($group_result->{status} eq "dll missing" and + } elsif ($group_result->{status} =~ /^(dll missing|skipped)$/ and $result->{status} eq "run") { $group_result->{status} = "run"; } elsif ($group_result->{status} eq "run" and - $result->{status} eq "dll missing") { + $result->{status} =~ /^(dll missing|skipped)$/) { ; # Nothing to do } elsif ($group_result->{status} ne $result->{status}) { $group_result->{status} = "mixed"; @@ -232,7 +242,7 @@ foreach my $group (@groups) { my $filelimit = $report->{filelimit}; if (exists $report->{dllmissing}->{$dll}) { # Mark this test as missing because of a missing dll - $report->{$testname} = { status => "dll missing", + $report->{$testname} = { status => $report->{dllmissing}->{$dll}, count => [ 1, 1 ], skips => [ 1, 1 ] }; @@ -256,6 +266,7 @@ foreach my $group (@groups) { } $group->{$testname} = $group_result; if ($group_result->{status} eq "dll missing" or + $group_result->{status} eq "skipped" or ($group_result->{status} eq "run" and $group_result->{errors}->[1] == 0 and $group_result->{todos}->[1] == 0 and @@ -278,7 +289,7 @@ foreach my $group (@groups) { $report->{todos} = 0; foreach my $testname (sort keys %alltests) { my $result = $report->{$testname}; - if ($result->{status} !~ /^(?:dll missing|run)$/ or + if ($result->{status} !~ /^(?:dll missing|run|skipped)$/ or ($result->{status} eq "run" and $result->{errors}->[1] != 0)) { @@ -427,7 +438,7 @@ sub get_result_class($) $class .= " also-skip" if ($result->{skips}->[1]); return "result $class"; } - if ($result->{status} eq "dll missing") + if ($result->{status} eq "dll missing" or $result->{status} eq "skipped") { return "result pass also-skip"; } @@ -455,6 +466,7 @@ sub get_result_title($$) $dll.=".dll" if ($dll !~ /./); return "No tests run as $dll is not present on this system"; } + if ($result->{status} eq "skipped") { return "Test skipped by user request"; } if ($result->{status} eq "winetest crash") { return "Test did not run as winetest crashed"; } if ($result->{status} eq "filelimit") { return "Test is missing because of a partial report file"; } if ($result->{status} eq "missing") { return "Test did not run for an unknown reason"; } @@ -526,6 +538,10 @@ sub singletest($$$) { { $msg = "not run"; } + elsif ($status eq "skipped") + { + $msg = "skipped"; + } elsif ($status eq "mixed") { $msg = "mixed";