Fixed the stop hook test after recent editline changes.
authorGreg Clayton <gclayton@apple.com>
Tue, 18 Nov 2014 19:45:23 +0000 (19:45 +0000)
committerGreg Clayton <gclayton@apple.com>
Tue, 18 Nov 2014 19:45:23 +0000 (19:45 +0000)
llvm-svn: 222246

lldb/test/functionalities/stop-hook/TestStopHookMechanism.py

index 5e71e90..d1fee2b 100644 (file)
@@ -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')