test events: announce worker count in new initialize event
See the following for details:
http://reviews.llvm.org/D12987
llvm-svn: 248059
diff --git a/lldb/test/dotest_args.py b/lldb/test/dotest_args.py
index 4d9d4c3..87213c5 100644
--- a/lldb/test/dotest_args.py
+++ b/lldb/test/dotest_args.py
@@ -1,4 +1,5 @@
import sys
+import multiprocessing
import os
import textwrap
@@ -26,6 +27,16 @@
else:
return parser.parse_args(args=argv)
+
+def default_thread_count():
+ # Check if specified in the environment
+ num_threads_str = os.environ.get("LLDB_TEST_THREADS")
+ if num_threads_str:
+ return int(num_threads_str)
+ else:
+ return multiprocessing.cpu_count()
+
+
def create_parser():
parser = argparse.ArgumentParser(description='description', prefix_chars='+-', add_help=False)
group = None
@@ -126,6 +137,7 @@
'--threads',
type=int,
dest='num_threads',
+ default=default_thread_count(),
help=('The number of threads/processes to use when running tests '
'separately, defaults to the number of CPU cores available'))
group.add_argument(