Johnny Chen | 05178f6 | 2011-03-04 23:40:06 +0000 | [diff] [blame^] | 1 | """ |
| 2 | Test lldb 'process connect' command. |
| 3 | """ |
| 4 | |
| 5 | import os, time |
| 6 | import unittest2 |
| 7 | import lldb |
| 8 | from lldbtest import * |
| 9 | |
| 10 | class ConnectRemoteTestCase(TestBase): |
| 11 | |
| 12 | mydir = "connect_remote" |
| 13 | |
| 14 | def test_connect_remote(self): |
| 15 | """Test "process connect connect:://localhost:12345".""" |
| 16 | |
| 17 | # First, we'll start a fake debugserver (a simple echo server). |
| 18 | import subprocess |
| 19 | fakeserver = subprocess.Popen('./EchoServer.py') |
| 20 | # This does the cleanup afterwards. |
| 21 | def cleanup_fakeserver(): |
| 22 | fakeserver.kill() |
| 23 | fakeserver.wait() |
| 24 | self.addTearDownHook(cleanup_fakeserver) |
| 25 | |
| 26 | self.runCmd("process connect connect://localhost:12345") |
| 27 | |
| 28 | |
| 29 | if __name__ == '__main__': |
| 30 | import atexit |
| 31 | lldb.SBDebugger.Initialize() |
| 32 | atexit.register(lambda: lldb.SBDebugger.Terminate()) |
| 33 | unittest2.main() |