[Lldb-commits] [lldb] r120294 - /lldb/trunk/test/dotest.py

Johnny Chen johnny.chen at apple.com
Mon Nov 29 09:50:10 PST 2010


Author: johnny
Date: Mon Nov 29 11:50:10 2010
New Revision: 120294

URL: http://llvm.org/viewvc/llvm-project?rev=120294&view=rev
Log:
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.

Modified:
    lldb/trunk/test/dotest.py

Modified: lldb/trunk/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=120294&r1=120293&r2=120294&view=diff
==============================================================================
--- lldb/trunk/test/dotest.py (original)
+++ lldb/trunk/test/dotest.py Mon Nov 29 11:50:10 2010
@@ -718,9 +718,10 @@
             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 @@
             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:





More information about the lldb-commits mailing list