summaryrefslogtreecommitdiff
path: root/selftest
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@sernet.private>2009-11-16 16:27:39 +0100
committerStefan Metzmacher <metze@samba.org>2009-11-17 09:00:46 +0100
commit36d0b1fa0deb3c03dff4ad85fad68fc16622b37e (patch)
tree874f756fb0b1141537bfd497e5a886172aa1e4d2 /selftest
parentdc351a579dbdffc5505205d3e1d5548f5e62336e (diff)
downloadsamba-36d0b1fa0deb3c03dff4ad85fad68fc16622b37e.tar.gz
samba-36d0b1fa0deb3c03dff4ad85fad68fc16622b37e.tar.bz2
samba-36d0b1fa0deb3c03dff4ad85fad68fc16622b37e.zip
selftest: Fix unexpected failure handline in Subunit/Filter.pm
We should only mark the testsuite as expected failure, if there were more than 1 expected failure, but 0 unexpected failures. Before we ignored unexpected failures if there was an expected failure within a testsuite. metze
Diffstat (limited to 'selftest')
-rw-r--r--selftest/Subunit/Filter.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/selftest/Subunit/Filter.pm b/selftest/Subunit/Filter.pm
index 93b690df8e..b7df762b1a 100644
--- a/selftest/Subunit/Filter.pm
+++ b/selftest/Subunit/Filter.pm
@@ -95,6 +95,10 @@ sub end_test($$$$$)
$reason .= $xfail_reason;
}
+ if ($result eq "fail" or $result eq "failure") {
+ $self->{fail_added}++;
+ }
+
if ($self->{strip_ok_output}) {
unless ($result eq "success" or $result eq "xfail" or $result eq "skip") {
print $self->{output}
@@ -115,16 +119,18 @@ sub start_testsuite($;$)
{
my ($self, $name) = @_;
Subunit::start_testsuite($name);
+ $self->{fail_added} = 0;
$self->{xfail_added} = 0;
}
sub end_testsuite($$;$)
{
my ($self, $name, $result, $reason) = @_;
- if ($self->{xfail_added} and ($result eq "fail" or $result eq "failure")) {
+ if ($self->{fail_added} == 0 and $self->{xfail_added} and
+ ($result eq "fail" or $result eq "failure")) {
$result = "xfail";
}
-
+
Subunit::end_testsuite($name, $result, $reason);
}