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

Johnny Chen johnny.chen at apple.com
Fri Dec 3 11:59:35 PST 2010


Author: johnny
Date: Fri Dec  3 13:59:35 2010
New Revision: 120837

URL: http://llvm.org/viewvc/llvm-project?rev=120837&view=rev
Log:
Add the '-F' option to the test driver, which makes the running of test suite failfast.
As soon as an error or a failure is encountered, it stops the test suite.

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=120837&r1=120836&r2=120837&view=diff
==============================================================================
--- lldb/trunk/test/dotest.py (original)
+++ lldb/trunk/test/dotest.py Fri Dec  3 13:59:35 2010
@@ -64,6 +64,9 @@
 # Delay startup in order for the debugger to attach.
 delay = False
 
+# By default, failfast is False.  Use '-F' to overwrite it.
+failfast = False
+
 # The filter (testclass.testmethod) used to admit tests into our test suite.
 filterspec = None
 
@@ -114,6 +117,7 @@
 -c   : read a config file specified after this option
        (see also lldb-trunk/example/test/usage-config)
 -d   : delay startup for 10 seconds (in order for the debugger to attach)
+-F   : failfast, stop the test suite on the first error/failure
 -f   : specify a filter, which consists of the test class name, a dot, followed by
        the test method, to only admit such test into the test suite
        e.g., -f 'ClassTypesTestCase.test_with_dwarf_and_python_api'
@@ -232,6 +236,7 @@
     global configFile
     global count
     global delay
+    global failfast
     global filterspec
     global fs4all
     global ignore
@@ -280,6 +285,9 @@
         elif sys.argv[index].startswith('-d'):
             delay = True
             index += 1
+        elif sys.argv[index].startswith('-F'):
+            failfast = True
+            index += 1
         elif sys.argv[index].startswith('-f'):
             # Increment by 1 to fetch the filter spec.
             index += 1
@@ -780,7 +788,9 @@
 
         # Invoke the test runner.
         if count == 1:
-            result = unittest2.TextTestRunner(stream=sys.stderr, verbosity=verbose,
+            result = unittest2.TextTestRunner(stream=sys.stderr,
+                                              verbosity=verbose,
+                                              failfast=failfast,
                                               resultclass=LLDBTestResult).run(suite)
         else:
             # We are invoking the same test suite more than once.  In this case,
@@ -788,7 +798,9 @@
             # not enforced.
             LLDBTestResult.__ignore_singleton__ = True
             for i in range(count):
-                result = unittest2.TextTestRunner(stream=sys.stderr, verbosity=verbose,
+                result = unittest2.TextTestRunner(stream=sys.stderr,
+                                                  verbosity=verbose,
+                                                  failfast=failfast,
                                                   resultclass=LLDBTestResult).run(suite)
         
 





More information about the lldb-commits mailing list