diff options
author | Johnny Chen <johnny.chen@apple.com> | 2011-05-03 22:14:19 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2011-05-03 22:14:19 +0000 |
commit | c4ca1b33f4778cb66926dcdcfcd804e2ae622c12 (patch) | |
tree | 76c8a622e6d5eb6984c253c5f55c38bab614e7d8 /test/lldbtest.py | |
parent | e1f50b9df1299f6b9181b5ac2699ed4a3ad38a59 (diff) | |
download | lldb-c4ca1b33f4778cb66926dcdcfcd804e2ae622c12.tar.gz |
Use a more gentle way of shutting down the child process spawned during the test execution using pexpect.
Change some child.expect() to child.expect_exact() as they try to match the string, not a regular expression.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@130797 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/lldbtest.py')
-rw-r--r-- | test/lldbtest.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/lldbtest.py b/test/lldbtest.py index a0cb3cdaf..35c2595d2 100644 --- a/test/lldbtest.py +++ b/test/lldbtest.py @@ -678,12 +678,15 @@ class TestBase(unittest2.TestCase): # This is for the case of directly spawning 'lldb' and interacting with it # using pexpect. + import pexpect if self.child and self.child.isalive(): with recording(self, traceAlways) as sbuf: print >> sbuf, "tearing down the child process...." self.child.sendline('quit') - time.sleep(2) - self.child.close() + try: + self.child.expect(pexpect.EOF) + except: + pass # Terminate the current process being debugged, if any. if self.runStarted: |