summaryrefslogtreecommitdiff
path: root/selftest/Subunit
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-06-05 16:55:45 +0200
committerJelmer Vernooij <jelmer@samba.org>2009-06-11 19:59:59 +0200
commitd8a77a798b5c691c76fcbadbc41c97ff1c9922f3 (patch)
tree949e80dade2618002b36173be2082c833ce3909b /selftest/Subunit
parent2e311fdac56f43998bb192418f617e6e7a6fc320 (diff)
downloadsamba-d8a77a798b5c691c76fcbadbc41c97ff1c9922f3.tar.gz
samba-d8a77a798b5c691c76fcbadbc41c97ff1c9922f3.tar.bz2
samba-d8a77a798b5c691c76fcbadbc41c97ff1c9922f3.zip
selftest: Properly recognize xfail testsuites.
Diffstat (limited to 'selftest/Subunit')
-rw-r--r--selftest/Subunit/Filter.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/selftest/Subunit/Filter.pm b/selftest/Subunit/Filter.pm
index 3a9e4f9409..1bd4e5fed2 100644
--- a/selftest/Subunit/Filter.pm
+++ b/selftest/Subunit/Filter.pm
@@ -76,10 +76,14 @@ sub end_test($$$$$)
$testname = $self->{prefix}.$testname;
}
- if (($result eq "fail" or $result eq "failure") and not $unexpected) { $result = "xfail"; }
+ if (($result eq "fail" or $result eq "failure") and not $unexpected) {
+ $result = "xfail";
+ $self->{xfail_added}++;
+ }
my $xfail_reason = find_in_list($self->{expected_failures}, $testname);
if (defined($xfail_reason) and ($result eq "fail" or $result eq "failure")) {
$result = "xfail";
+ $self->{xfail_added}++;
$reason .= $xfail_reason;
}
@@ -95,11 +99,16 @@ sub start_testsuite($;$)
{
my ($self, $name) = @_;
Subunit::start_testsuite($name);
+ $self->{xfail_added} = 0;
}
sub end_testsuite($$;$)
{
my ($self, $name, $result, $reason) = @_;
+ if ($self->{xfail_added} and ($result eq "fail" or $result eq "failure")) {
+ $result = "xfail";
+ }
+
Subunit::end_testsuite($name, $result, $reason);
}
@@ -115,6 +124,7 @@ sub new {
my $self = {
prefix => $prefix,
expected_failures => $expected_failures,
+ xfail_added => 0,
};
bless($self, $class);
}