diff options
author | Zachary Turner <zturner@google.com> | 2015-12-08 01:15:30 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2015-12-08 01:15:30 +0000 |
commit | 606e3a5221ec611a2f5da6d9a4961e8e2199f9d2 (patch) | |
tree | a71b819581216c1153340efce0baafd6a7da6941 /lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py | |
parent | da30cff9ef2e22cf9e8e307f132976a15feacdf8 (diff) | |
download | bcm5719-llvm-606e3a5221ec611a2f5da6d9a4961e8e2199f9d2.tar.gz bcm5719-llvm-606e3a5221ec611a2f5da6d9a4961e8e2199f9d2.zip |
Get rid of global variables in dotest.py
This moves all the global variables into a separate module called
`configuration`. This has a number of advantages:
1. Configuration data is centrally maintained so it's easy to get
a high level overview of what configuration data the test suite
makes use of.
2. The method of sharing configuration data among different parts
of the test suite becomes standardized. Previously we would
put some things into the `lldb` module, some things into the
`lldbtest_config` module, and some things would not get shared.
Now everything is shared through one module and is available to
the entire test suite.
3. It opens the door to moving some of the initialization code into
the `configuration` module, simplifying the implementation of
`dotest.py`.
There are a few stragglers that didn't get converted over to using
the `configuration` module in this patch, because it would have grown
the size of the patch unnecessarily. This includes everything
currently in the `lldbtest_config` module, as well as the
`lldb.remote_platform` variable. We can address these in the future.
llvm-svn: 254982
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py index 5ebd16e3a15..f796c6d02ed 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py @@ -19,6 +19,7 @@ import subprocess import sys import tempfile import time +from lldbsuite.test import configuration from lldbsuite.test.lldbtest import * from lldbgdbserverutils import * import logging @@ -60,13 +61,13 @@ class GdbRemoteTestCaseBase(TestBase): self.named_pipe = None self.named_pipe_fd = None self.stub_sends_two_stop_notifications_on_kill = False - if lldb.platform_url: - if lldb.platform_url.startswith('unix-'): + if configuration.lldb_platform_url: + if configuration.lldb_platform_url.startswith('unix-'): url_pattern = '(.+)://\[?(.+?)\]?/.*' else: url_pattern = '(.+)://(.+):\d+' - scheme, host = re.match(url_pattern, lldb.platform_url).groups() - if lldb.remote_platform_name == 'remote-android' and host != 'localhost': + scheme, host = re.match(url_pattern, configuration.lldb_platform_url).groups() + if configuration.lldb_platform_name == 'remote-android' and host != 'localhost': self.stub_device = host self.stub_hostname = 'localhost' else: |