When looping through the test suite more than once (repeat count > 1), we should

ignore and not enforce the signleton pattern for the LLDBTestResult class.

llvm-svn: 120294
This commit is contained in:
Johnny Chen 2010-11-29 17:50:10 +00:00
parent da4a6272fa
commit 46389e9ddf
1 changed files with 5 additions and 2 deletions

View File

@ -718,9 +718,10 @@ for ia in range(len(archs) if iterArchs else 1):
to a log file for easier human inspection of test failres/errors.
"""
__singleton__ = None
__ignore_singleton__ = False
def __init__(self, *args):
if LLDBTestResult.__singleton__:
if not LLDBTestResult.__ignore_singleton__ and LLDBTestResult.__singleton__:
raise Exception("LLDBTestResult instantiated more than once")
super(LLDBTestResult, self).__init__(*args)
LLDBTestResult.__singleton__ = self
@ -756,8 +757,10 @@ for ia in range(len(archs) if iterArchs else 1):
result = unittest2.TextTestRunner(stream=sys.stderr, verbosity=verbose,
resultclass=LLDBTestResult).run(suite)
else:
LLDBTestResult.__ignore_singleton__ = True
for i in range(count):
result = unittest2.TextTestRunner(stream=sys.stderr, verbosity=verbose).run(suite)
result = unittest2.TextTestRunner(stream=sys.stderr, verbosity=verbose,
resultclass=LLDBTestResult).run(suite)
if sdir_has_content: