summaryrefslogtreecommitdiffstats
path: root/lldb/test/functionalities/connect_remote/TestConnectRemote.py
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-06-26 21:36:28 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-06-26 21:36:28 +0000
commit2027e2af214c5bad59737e8e7992b5e19d78adf0 (patch)
treeb5d840efb83ed55b02e9fea2f914785fb6fcd3bf /lldb/test/functionalities/connect_remote/TestConnectRemote.py
parent1429bcb3302b2edb05908ccd09855c13d54a951e (diff)
downloadbcm5719-llvm-2027e2af214c5bad59737e8e7992b5e19d78adf0.tar.gz
bcm5719-llvm-2027e2af214c5bad59737e8e7992b5e19d78adf0.zip
Move more top level test dirs to reside under functionalities dir.
llvm-svn: 133894
Diffstat (limited to 'lldb/test/functionalities/connect_remote/TestConnectRemote.py')
-rw-r--r--lldb/test/functionalities/connect_remote/TestConnectRemote.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/lldb/test/functionalities/connect_remote/TestConnectRemote.py b/lldb/test/functionalities/connect_remote/TestConnectRemote.py
new file mode 100644
index 00000000000..e36647e27c2
--- /dev/null
+++ b/lldb/test/functionalities/connect_remote/TestConnectRemote.py
@@ -0,0 +1,41 @@
+"""
+Test lldb 'process connect' command.
+"""
+
+import os
+import unittest2
+import lldb
+import pexpect
+from lldbtest import *
+
+class ConnectRemoteTestCase(TestBase):
+
+ mydir = os.path.join("functionalities", "connect_remote")
+
+ def test_connect_remote(self):
+ """Test "process connect connect:://localhost:12345"."""
+
+ # First, we'll start a fake debugserver (a simple echo server).
+ fakeserver = pexpect.spawn('./EchoServer.py')
+
+ # Turn on logging for what the child sends back.
+ if self.TraceOn():
+ fakeserver.logfile_read = sys.stdout
+
+ # Schedule the fake debugserver to be shutting down during teardown.
+ def shutdown_fakeserver():
+ fakeserver.close()
+ self.addTearDownHook(shutdown_fakeserver)
+
+ # Wait until we receive the server ready message before continuing.
+ fakeserver.expect_exact('Listening on localhost:12345')
+
+ # Connect to the fake server....
+ self.runCmd("process connect connect://localhost:12345")
+
+
+if __name__ == '__main__':
+ import atexit
+ lldb.SBDebugger.Initialize()
+ atexit.register(lambda: lldb.SBDebugger.Terminate())
+ unittest2.main()
OpenPOWER on IntegriCloud