Index: test/dosep.ty
===================================================================
--- test/dosep.ty	(revision 204068)
+++ test/dosep.ty	(working copy)
@@ -6,6 +6,7 @@
 
 import os, sys, platform
 import Queue, threading
+import multiprocessing
 
 from optparse import OptionParser
 
@@ -93,16 +94,25 @@
                       dest='dotest_options',
                       help="""The options passed to 'dotest.py' if specified.""")
 
+    parser.add_option('-t', '--threads',
+                      type='int',
+                      dest='num_threads',
+                      help="""The number of threads to use when running tests separately.""",
+                      default=multiprocessing.cpu_count())
+
     opts, args = parser.parse_args()
     dotest_options = opts.dotest_options
-    num_threads_str = os.environ.get("LLDB_TEST_THREADS")
-    if num_threads_str:
-        num_threads = int(num_threads_str)
-        if num_threads < 1:
+    num_threads = opts.num_threads
+    if num_threads < 1:
+        num_threads_str = os.environ.get("LLDB_TEST_THREADS")
+        if num_threads_str:
+            num_threads = int(num_threads_str)
+            if num_threads < 1:
+                num_threads = 1
+        else:
             num_threads = 1
-    else:
-        num_threads = 1
 
+    print "Running tests with %u threads" % (num_threads)
     system_info = " ".join(platform.uname())
     (failed, passed) = walk_and_invoke(test_root, dotest_options, num_threads)
     num_tests = len(failed) + len(passed)
