summaryrefslogtreecommitdiffstats
path: root/selftest
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-11-17 15:27:29 +0100
committerStefan Metzmacher <metze@samba.org>2009-11-18 08:24:13 +0100
commit61f5adb25600392b262273d208613e8229f6389a (patch)
tree2d587ccb84729b647459ee5992c183f7ac8b726f /selftest
parentfb685d3a8afed4c14f5e7a17ef58225c2946ed67 (diff)
downloadsamba-61f5adb25600392b262273d208613e8229f6389a.tar.gz
samba-61f5adb25600392b262273d208613e8229f6389a.tar.xz
samba-61f5adb25600392b262273d208613e8229f6389a.zip
selftest: Subunit/Filter.pm only allow expected failures without errors
metze
Diffstat (limited to 'selftest')
-rw-r--r--selftest/Subunit/Filter.pm26
1 files changed, 24 insertions, 2 deletions
diff --git a/selftest/Subunit/Filter.pm b/selftest/Subunit/Filter.pm
index 3c226958bd..896721a67b 100644
--- a/selftest/Subunit/Filter.pm
+++ b/selftest/Subunit/Filter.pm
@@ -100,6 +100,10 @@ sub end_test($$$$$)
$self->{fail_added}++;
}
+ if ($result eq "error") {
+ $self->{error_added}++;
+ }
+
if ($self->{strip_ok_output}) {
unless ($result eq "success" or $result eq "xfail" or $result eq "skip") {
print $self->{output}
@@ -120,6 +124,7 @@ sub start_testsuite($;$)
{
my ($self, $name) = @_;
Subunit::start_testsuite($name);
+ $self->{error_added} = 0;
$self->{fail_added} = 0;
$self->{xfail_added} = 0;
}
@@ -127,11 +132,28 @@ sub start_testsuite($;$)
sub end_testsuite($$;$)
{
my ($self, $name, $result, $reason) = @_;
- if ($self->{fail_added} == 0 and $self->{xfail_added} and
- ($result eq "fail" or $result eq "failure")) {
+ my $xfail = 0;
+
+ $xfail = 1 if ($self->{xfail_added} > 0);
+ $xfail = 0 if ($self->{fail_added} > 0);
+ $xfail = 0 if ($self->{error_added} > 0);
+
+ if ($xfail and ($result eq "fail" or $result eq "failure")) {
$result = "xfail";
}
+ if ($self->{fail_added} > 0 and $result ne "failure") {
+ $result = "failure";
+ $reason = "Subunit/Filer Reason" unless defined($reason);
+ $reason .= "\n failures[$self->{fail_added}]";
+ }
+
+ if ($self->{error_added} > 0 and $result ne "error") {
+ $result = "error";
+ $reason = "Subunit/Filer Reason" unless defined($reason);
+ $reason .= "\n errors[$self->{error_added}]";
+ }
+
Subunit::end_testsuite($name, $result, $reason);
}