summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect
diff options
context:
space:
mode:
authorTamas Berghammer <tberghammer@google.com>2016-04-05 14:08:18 +0000
committerTamas Berghammer <tberghammer@google.com>2016-04-05 14:08:18 +0000
commit19fc1d4e3c19caa091b2fde161f54fa3b015b028 (patch)
treee1f82b192e7a24e1785aabd3fd801990f6b2ab7a /lldb/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect
parentd3fb38cae5227d9c23a2be5562b5f22c469c1b71 (diff)
downloadbcm5719-llvm-19fc1d4e3c19caa091b2fde161f54fa3b015b028.tar.gz
bcm5719-llvm-19fc1d4e3c19caa091b2fde161f54fa3b015b028.zip
[NFC] Cleanup the code used to run shell commands from tests
Previously we had 3 different method to run shell commands on the target and 4 copy of code waiting until a given file appears on the target device (used for syncronization). This CL merges these methods to 1 run_platform_command and 1 wait_for_file_on_target functions located in some utility classes. Differential revision: http://reviews.llvm.org/D18789 llvm-svn: 265398
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect')
-rw-r--r--lldb/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
index 015483519c8..5c28d288db5 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
@@ -38,11 +38,8 @@ class TestPlatformProcessConnect(gdbremote_testcase.GdbRemoteTestCaseBase):
commandline_args = ["platform", "--listen", listen_url, "--socket-file", port_file, "--", "%s/a.out" % working_dir, "foo"]
self.spawnSubprocess(self.debug_monitor_exe, commandline_args, install_remote=False)
self.addTearDownHook(self.cleanupSubprocesses)
-
- # Wait until the port_file have been created. Doing it with 1 shell command will fail because
- # of a bug in LLDB shell escaping code
- _, _ = self.run_platform_command("while [ ! -f %s ]; do sleep 0.25; done" % port_file)
- _, socket_id = self.run_platform_command("cat %s" % port_file)
+
+ socket_id = lldbutil.wait_for_file_on_target(self, port_file)
new_debugger = lldb.SBDebugger.Create()
new_debugger.SetAsync(False)
OpenPOWER on IntegriCloud