summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2015-07-06 15:57:52 +0000
committerPavel Labath <labath@google.com>2015-07-06 15:57:52 +0000
commit05ab2374be544bbda7deaa7593b3a884e64bd1bd (patch)
tree633a15e9593925b2b51db09d78e01a6b50616e35
parentc7689300bb4b1058b73d737727e29aff6af6a553 (diff)
downloadbcm5719-llvm-05ab2374be544bbda7deaa7593b3a884e64bd1bd.tar.gz
bcm5719-llvm-05ab2374be544bbda7deaa7593b3a884e64bd1bd.zip
Fix dosep.py on windows after r240946
Summary: On windows, global python variables are not automatically passed to child processes. This commit makes sure the default timeout value is available to child processes by passing it directly. I pass the whole dotest_opts value to the children, so we can use the other members as well if we need to do it in the future. Reviewers: amccarth Subscribers: lldb-commits-list Differential Revision: http://reviews.llvm.org/D10895 llvm-svn: 241459
-rwxr-xr-xlldb/test/dosep.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/lldb/test/dosep.py b/lldb/test/dosep.py
index 2a2ff82c0b5..fb1a5bd46c8 100755
--- a/lldb/test/dosep.py
+++ b/lldb/test/dosep.py
@@ -67,12 +67,14 @@ eTimedOut, ePassed, eFailed = 124, 0, 1
output_lock = None
test_counter = None
total_tests = None
+dotest_options = None
-def setup_lock_and_counter(lock, counter, total):
- global output_lock, test_counter, total_tests
+def setup_global_variables(lock, counter, total, options):
+ global output_lock, test_counter, total_tests, dotest_options
output_lock = lock
test_counter = counter
total_tests = total
+ dotest_options = options
def update_status(name = None, command = None, output = None):
global output_lock, test_counter, total_tests
@@ -152,7 +154,7 @@ def process_dir(root, files, test_root, dotest_argv):
timeout_name = os.path.basename(os.path.splitext(name)[0]).upper()
- timeout = os.getenv("LLDB_%s_TIMEOUT" % timeout_name) or default_timeout
+ timeout = os.getenv("LLDB_%s_TIMEOUT" % timeout_name) or getDefaultTimeout(dotest_options.lldb_platform_name)
exit_status, pass_count, fail_count = call_with_timeout(command, timeout, name)
@@ -202,8 +204,8 @@ def walk_and_invoke(test_directory, test_subdir, dotest_argv, num_threads):
# calling each individually.
if num_threads > 1:
pool = multiprocessing.Pool(num_threads,
- initializer = setup_lock_and_counter,
- initargs = (output_lock, test_counter, total_tests))
+ initializer = setup_global_variables,
+ initargs = (output_lock, test_counter, total_tests, dotest_options))
test_results = pool.map(process_dir_worker, test_work_items)
else:
test_results = []
@@ -336,6 +338,7 @@ Run lldb test suite using a separate process for each test file.
dotest_argv = shlex.split(dotest_option_string, posix=is_posix) if dotest_option_string else []
parser = dotest_args.create_parser()
+ global dotest_options
dotest_options = dotest_args.parse_args(parser, dotest_argv)
if not dotest_options.s:
@@ -372,9 +375,6 @@ Run lldb test suite using a separate process for each test file.
if num_threads < 1:
num_threads = 1
- global default_timeout
- default_timeout = getDefaultTimeout(dotest_options.lldb_platform_name)
-
system_info = " ".join(platform.uname())
(timed_out, failed, passed, all_fails, all_passes) = walk_and_invoke(test_directory, test_subdir, dotest_argv, num_threads)
OpenPOWER on IntegriCloud