diff options
author | Stefan Metzmacher <metze@samba.org> | 2014-03-12 15:12:42 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2014-03-13 21:45:12 +0100 |
commit | 14246953b2e91578e5f51faedfdf31926a5b1950 (patch) | |
tree | 389a0021e7ea0397ad1014f43d6825a51a866959 | |
parent | ab9f02193188af8e482052ee6b55c30aac2c8340 (diff) | |
download | samba-14246953b2e91578e5f51faedfdf31926a5b1950.tar.gz samba-14246953b2e91578e5f51faedfdf31926a5b1950.tar.xz samba-14246953b2e91578e5f51faedfdf31926a5b1950.zip |
selftest/subunithelper.py: correctly handle unexpected success in FilterOps
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r-- | selftest/subunithelper.py | 14 |
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: |