Add a test case for the lldb command 'process connect'.
We start a fake debugserver listening on localhost:12345 and issue the command
'process connect connect://localhost:12345' to connect to it.

llvm-svn: 127048
diff --git a/lldb/test/connect_remote/TestConnectRemote.py b/lldb/test/connect_remote/TestConnectRemote.py
new file mode 100644
index 0000000..1e5e9b7
--- /dev/null
+++ b/lldb/test/connect_remote/TestConnectRemote.py
@@ -0,0 +1,33 @@
+"""
+Test lldb 'process connect' command.
+"""
+
+import os, time
+import unittest2
+import lldb
+from lldbtest import *
+
+class ConnectRemoteTestCase(TestBase):
+
+    mydir = "connect_remote"
+
+    def test_connect_remote(self):
+        """Test "process connect connect:://localhost:12345"."""
+
+        # First, we'll start a fake debugserver (a simple echo server).
+        import subprocess
+        fakeserver = subprocess.Popen('./EchoServer.py')
+        # This does the cleanup afterwards.
+        def cleanup_fakeserver():
+            fakeserver.kill()
+            fakeserver.wait()
+        self.addTearDownHook(cleanup_fakeserver)
+
+        self.runCmd("process connect connect://localhost:12345")
+
+
+if __name__ == '__main__':
+    import atexit
+    lldb.SBDebugger.Initialize()
+    atexit.register(lambda: lldb.SBDebugger.Terminate())
+    unittest2.main()