mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 21:55:39 +08:00
Fixed the stop hook test after recent editline changes.
llvm-svn: 222246
This commit is contained in:
@@ -40,9 +40,10 @@ class StopHookMechanismTestCase(TestBase):
|
||||
import pexpect
|
||||
exe = os.path.join(os.getcwd(), "a.out")
|
||||
prompt = "(lldb) "
|
||||
add_prompt = "Enter your stop hook command(s). Type 'DONE' to end.\r\n> "
|
||||
add_prompt1 = "\r\n> "
|
||||
add_prompt = "Enter your stop hook command(s). Type 'DONE' to end."
|
||||
add_prompt1 = "> "
|
||||
|
||||
print 'lldbOption = "%s"' % self.lldbOption
|
||||
# So that the child gets torn down after the test.
|
||||
self.child = pexpect.spawn('%s %s %s' % (self.lldbHere, self.lldbOption, exe))
|
||||
child = self.child
|
||||
@@ -58,6 +59,7 @@ class StopHookMechanismTestCase(TestBase):
|
||||
child.expect_exact(prompt)
|
||||
child.sendline('target stop-hook add -f main.cpp -l %d -e %d' % (self.begl, self.endl))
|
||||
child.expect_exact(add_prompt)
|
||||
child.expect_exact(add_prompt1)
|
||||
child.sendline('expr ptr')
|
||||
child.expect_exact(add_prompt1)
|
||||
child.sendline('DONE')
|
||||
@@ -67,6 +69,8 @@ class StopHookMechanismTestCase(TestBase):
|
||||
# Now run the program, expect to stop at the the first breakpoint which is within the stop-hook range.
|
||||
child.expect_exact(prompt)
|
||||
child.sendline('run')
|
||||
# Make sure we see the stop hook text from the stop of the process from the run hitting the first breakpoint
|
||||
child.expect_exact('(void *) $')
|
||||
child.expect_exact(prompt)
|
||||
child.sendline('thread step-over')
|
||||
# Expecting to find the output emitted by the firing of our stop hook.
|
||||
@@ -77,7 +81,9 @@ class StopHookMechanismTestCase(TestBase):
|
||||
# I fixed that in lldb and I'm sticking in a test here because I don't want to have to
|
||||
# make up a whole nother test case for it.
|
||||
child.sendline('frame info')
|
||||
child.expect_exact('at main.cpp:%d'%self.correct_step_line)
|
||||
at_line = 'at main.cpp:%d' % (self.correct_step_line)
|
||||
print 'expecting "%s"' % at_line
|
||||
child.expect_exact(at_line)
|
||||
|
||||
# Now continue the inferior, we'll stop at another breakpoint which is outside the stop-hook range.
|
||||
child.sendline('process continue')
|
||||
|
||||
Reference in New Issue
Block a user