[Lldb-commits] [lldb] r222246 - Fixed the stop hook test after recent editline changes.

Greg Clayton gclayton at apple.com
Tue Nov 18 11:45:23 PST 2014


Author: gclayton
Date: Tue Nov 18 13:45:23 2014
New Revision: 222246

URL: http://llvm.org/viewvc/llvm-project?rev=222246&view=rev
Log:
Fixed the stop hook test after recent editline changes.


Modified:
    lldb/trunk/test/functionalities/stop-hook/TestStopHookMechanism.py

Modified: lldb/trunk/test/functionalities/stop-hook/TestStopHookMechanism.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/stop-hook/TestStopHookMechanism.py?rev=222246&r1=222245&r2=222246&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/stop-hook/TestStopHookMechanism.py (original)
+++ lldb/trunk/test/functionalities/stop-hook/TestStopHookMechanism.py Tue Nov 18 13:45:23 2014
@@ -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')





More information about the lldb-commits mailing list