1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

subunit: Don't abort when receiving test results from tests that weren't

announced.
This commit is contained in:
Jelmer Vernooij 2010-04-10 22:35:57 +02:00
parent 64bf8c400c
commit 664eacc53a

View File

@ -68,16 +68,34 @@ def parse_results(msg_ops, statistics, fh):
else: else:
reason = None reason = None
if result in ("success", "successful"): if result in ("success", "successful"):
open_tests.pop() #FIXME: Check that popped value == $testname try:
open_tests.remove(testname)
except KeyError:
statistics['TESTS_ERROR']+=1
msg_ops.end_test(testname, "error", True,
"Test was never started")
else:
statistics['TESTS_EXPECTED_OK']+=1 statistics['TESTS_EXPECTED_OK']+=1
msg_ops.end_test(testname, "success", False, reason) msg_ops.end_test(testname, "success", False, reason)
elif result in ("xfail", "knownfail"): elif result in ("xfail", "knownfail"):
open_tests.pop() #FIXME: Check that popped value == $testname try:
open_tests.remove(testname)
except KeyError:
statistics['TESTS_ERROR']+=1
msg_ops.end_test(testname, "error", True,
"Test was never started")
else:
statistics['TESTS_EXPECTED_FAIL']+=1 statistics['TESTS_EXPECTED_FAIL']+=1
msg_ops.end_test(testname, "xfail", False, reason) msg_ops.end_test(testname, "xfail", False, reason)
expected_fail+=1 expected_fail+=1
elif result in ("failure", "fail"): elif result in ("failure", "fail"):
open_tests.pop() #FIXME: Check that popped value == $testname try:
open_tests.remove(testname)
except KeyError:
statistics['TESTS_ERROR']+=1
msg_ops.end_test(testname, "error", True,
"Test was never started")
else:
statistics['TESTS_UNEXPECTED_FAIL']+=1 statistics['TESTS_UNEXPECTED_FAIL']+=1
msg_ops.end_test(testname, "failure", True, reason) msg_ops.end_test(testname, "failure", True, reason)
elif result == "skip": elif result == "skip":
@ -89,7 +107,10 @@ def parse_results(msg_ops, statistics, fh):
msg_ops.end_test(testname, "skip", False, reason) msg_ops.end_test(testname, "skip", False, reason)
elif result == "error": elif result == "error":
statistics['TESTS_ERROR']+=1 statistics['TESTS_ERROR']+=1
open_tests.pop() #FIXME: Check that popped value == $testname try:
open_tests.remove(testname)
except KeyError:
pass
msg_ops.end_test(testname, "error", True, reason) msg_ops.end_test(testname, "error", True, reason)
elif result == "skip-testsuite": elif result == "skip-testsuite":
msg_ops.skip_testsuite(testname) msg_ops.skip_testsuite(testname)