aboutsummaryrefslogtreecommitdiff
path: root/test/lldbtest.py
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-05-03 22:14:19 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-05-03 22:14:19 +0000
commitc4ca1b33f4778cb66926dcdcfcd804e2ae622c12 (patch)
tree76c8a622e6d5eb6984c253c5f55c38bab614e7d8 /test/lldbtest.py
parente1f50b9df1299f6b9181b5ac2699ed4a3ad38a59 (diff)
downloadlldb-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.py7
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: