summaryrefslogtreecommitdiff
path: root/selftest
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-03-12 15:12:42 +0100
committerKarolin Seeger <kseeger@samba.org>2014-07-15 12:46:12 +0200
commitbe09c41307b94c5a7c5cfc08d618a01b63598fbf (patch)
tree0cb7e493b02dc803869f93d69fabcd5116501537 /selftest
parent2354597e4ec683800399137450932219663bf6d6 (diff)
downloadsamba-be09c41307b94c5a7c5cfc08d618a01b63598fbf.tar.gz
selftest/subunithelper.py: correctly handle unexpected success in FilterOps
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 14246953b2e91578e5f51faedfdf31926a5b1950)
Diffstat (limited to 'selftest')
-rw-r--r--selftest/subunithelper.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/selftest/subunithelper.py b/selftest/subunithelper.py
index 057e1390508..8b10016bb85 100644
--- a/selftest/subunithelper.py
+++ b/selftest/subunithelper.py
@@ -301,8 +301,14 @@ class FilterOps(testtools.testresult.TestResult):
def addUnexpectedSuccess(self, test, details=None):
test = self._add_prefix(test)
+ self.uxsuccess_added+=1
+ self.total_uxsuccess+=1
self._ops.addUnexpectedSuccess(test, details)
+ if self.output:
+ self._ops.output_msg(self.output)
self.output = None
+ if self.fail_immediately:
+ raise ImmediateFail()
def addFailure(self, test, details=None):
test = self._add_prefix(test)
@@ -362,12 +368,18 @@ class FilterOps(testtools.testresult.TestResult):
if self.xfail_added > 0:
xfail = True
- if self.fail_added > 0 or self.error_added > 0:
+ if self.fail_added > 0 or self.error_added > 0 or self.uxsuccess_added > 0:
xfail = False
if xfail and result in ("fail", "failure"):
result = "xfail"
+ if self.uxsuccess_added > 0 and result != "uxsuccess":
+ result = "uxsuccess"
+ if reason is None:
+ reason = "Subunit/Filter Reason"
+ reason += "\n uxsuccess[%d]" % self.uxsuccess_added
+
if self.fail_added > 0 and result != "failure":
result = "failure"
if reason is None: