diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-10-19 13:25:55 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-10-19 13:51:17 +1100 |
commit | 1de7e43fb4a4863e3663af8b2a2d9f19cf82d7f3 (patch) | |
tree | a709544033f018d46870e373cf25c2ad704a78a8 /selftest | |
parent | 959accb4e62f528fa9aa62f1405e00912e73f20f (diff) | |
download | samba-1de7e43fb4a4863e3663af8b2a2d9f19cf82d7f3.tar.gz samba-1de7e43fb4a4863e3663af8b2a2d9f19cf82d7f3.tar.bz2 samba-1de7e43fb4a4863e3663af8b2a2d9f19cf82d7f3.zip |
selftest: fixed filter to know about a "error" result
This is what caused some of the python tests to not match knownfail
entries
Diffstat (limited to 'selftest')
-rw-r--r-- | selftest/Subunit/Filter.pm | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/selftest/Subunit/Filter.pm b/selftest/Subunit/Filter.pm index 93b690df8e..2b390d189a 100644 --- a/selftest/Subunit/Filter.pm +++ b/selftest/Subunit/Filter.pm @@ -76,6 +76,12 @@ sub start_test($$) Subunit::start_test($testname); } +sub is_failure($) +{ + my ($result) = @_; + return $result eq "fail" or $result eq "failure" or $result eq "error"; +} + sub end_test($$$$$) { my ($self, $testname, $result, $unexpected, $reason) = @_; @@ -84,12 +90,12 @@ sub end_test($$$$$) $testname = $self->{prefix}.$testname; } - if (($result eq "fail" or $result eq "failure") and not $unexpected) { + if (is_failure($result) 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")) { + if (defined($xfail_reason) and is_failure($result)) { $result = "xfail"; $self->{xfail_added}++; $reason .= $xfail_reason; @@ -121,7 +127,7 @@ sub start_testsuite($;$) sub end_testsuite($$;$) { my ($self, $name, $result, $reason) = @_; - if ($self->{xfail_added} and ($result eq "fail" or $result eq "failure")) { + if ($self->{xfail_added} and is_failure($result)) { $result = "xfail"; } |