[Lldb-commits] [lldb] r224990 - Cleanup lldb-mi test cases.
Hafiz Abid Qadeer
hafiz_abid at mentor.com
Tue Dec 30 09:11:31 PST 2014
Author: abidh
Date: Tue Dec 30 11:11:31 2014
New Revision: 224990
URL: http://llvm.org/viewvc/llvm-project?rev=224990&view=rev
Log:
Cleanup lldb-mi test cases.
Following changes were done.
1. Remove the extra line after -exec-run.
2. Remove check for prompt.
3. Remove 'quit' command.
Initial patch was contributed by ki.stfu at gmail.com.
Modified:
lldb/trunk/test/tools/lldb-mi/TestMiBreakpoint.py
lldb/trunk/test/tools/lldb-mi/TestMiEvaluate.py
lldb/trunk/test/tools/lldb-mi/TestMiInterrupt.py
lldb/trunk/test/tools/lldb-mi/TestMiLaunch.py
lldb/trunk/test/tools/lldb-mi/TestMiProgramArgs.py
lldb/trunk/test/tools/lldb-mi/TestMiSyntax.py
Modified: lldb/trunk/test/tools/lldb-mi/TestMiBreakpoint.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/TestMiBreakpoint.py?rev=224990&r1=224989&r2=224990&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/TestMiBreakpoint.py (original)
+++ lldb/trunk/test/tools/lldb-mi/TestMiBreakpoint.py Tue Dec 30 11:11:31 2014
@@ -28,9 +28,6 @@ class MiBreakpointTestCase(TestBase):
import pexpect
self.buildDefault()
- # The default lldb-mi prompt (seriously?!).
- prompt = "(gdb)"
-
# So that the child gets torn down after the test.
self.child = pexpect.spawn('%s --interpreter' % (self.lldbMiExec))
child = self.child
@@ -48,16 +45,12 @@ class MiBreakpointTestCase(TestBase):
child.expect("\^done,bkpt={number=\"1\"")
child.sendline("-exec-run")
- child.sendline("") # FIXME: lldb-mi hangs here, so extra return is needed
child.expect("\^running")
child.expect("\*stopped,reason=\"breakpoint-hit\"")
child.sendline("-exec-continue")
child.expect("\^running")
child.expect("\*stopped,reason=\"exited-normally\"")
- child.expect_exact(prompt)
-
- child.sendline("quit")
# Now that the necessary logging is done, restore logfile to None to
# stop further logging.
@@ -83,9 +76,6 @@ class MiBreakpointTestCase(TestBase):
import pexpect
self.buildDefault()
- # The default lldb-mi prompt (seriously?!).
- prompt = "(gdb)"
-
# So that the child gets torn down after the test.
self.child = pexpect.spawn('%s --interpreter' % (self.lldbMiExec))
child = self.child
@@ -106,16 +96,12 @@ class MiBreakpointTestCase(TestBase):
child.expect("\^done,bkpt={number=\"1\"")
child.sendline("-exec-run")
- child.sendline("") # FIXME: lldb-mi hangs here, so extra return is needed
child.expect("\^running")
child.expect("\*stopped,reason=\"breakpoint-hit\"")
child.sendline("-exec-continue")
child.expect("\^running")
child.expect("\*stopped,reason=\"exited-normally\"")
- child.expect_exact(prompt)
-
- child.sendline("quit")
# Now that the necessary logging is done, restore logfile to None to
# stop further logging.
@@ -141,9 +127,6 @@ class MiBreakpointTestCase(TestBase):
import pexpect
self.buildDefault()
- # The default lldb-mi prompt (seriously?!).
- prompt = "(gdb)"
-
# So that the child gets torn down after the test.
self.child = pexpect.spawn('%s --interpreter' % (self.lldbMiExec))
child = self.child
@@ -161,7 +144,6 @@ class MiBreakpointTestCase(TestBase):
child.expect("\^done,bkpt={number=\"1\"")
child.sendline("-exec-run")
- child.sendline("") # FIXME: lldb-mi hangs here, so extra return is needed
child.expect("\^running")
child.expect("\*stopped,reason=\"breakpoint-hit\"")
@@ -186,9 +168,6 @@ class MiBreakpointTestCase(TestBase):
child.sendline("-exec-continue")
child.expect("\^running")
child.expect("\*stopped,reason=\"exited-normally\"")
- child.expect_exact(prompt)
-
- child.sendline("quit")
# Now that the necessary logging is done, restore logfile to None to
# stop further logging.
Modified: lldb/trunk/test/tools/lldb-mi/TestMiEvaluate.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/TestMiEvaluate.py?rev=224990&r1=224989&r2=224990&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/TestMiEvaluate.py (original)
+++ lldb/trunk/test/tools/lldb-mi/TestMiEvaluate.py Tue Dec 30 11:11:31 2014
@@ -28,9 +28,6 @@ class MiEvaluateTestCase(TestBase):
import pexpect
self.buildDefault()
- # The default lldb-mi prompt (seriously?!).
- prompt = "(gdb)"
-
# So that the child gets torn down after the test.
self.child = pexpect.spawn('%s --interpreter' % (self.lldbMiExec))
child = self.child
@@ -49,7 +46,6 @@ class MiEvaluateTestCase(TestBase):
child.expect("\^done,bkpt={number=\"1\"")
child.sendline("-exec-run")
- child.sendline("") #FIXME: hangs here; extra return is needed
child.expect("\^running")
child.expect("\*stopped,reason=\"breakpoint-hit\"")
@@ -111,9 +107,6 @@ class MiEvaluateTestCase(TestBase):
child.sendline("-exec-continue")
child.expect("\^running")
child.expect("\*stopped,reason=\"exited-normally\"")
- child.expect_exact(prompt)
-
- child.sendline("quit")
# Now that the necessary logging is done, restore logfile to None to
# stop further logging.
Modified: lldb/trunk/test/tools/lldb-mi/TestMiInterrupt.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/TestMiInterrupt.py?rev=224990&r1=224989&r2=224990&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/TestMiInterrupt.py (original)
+++ lldb/trunk/test/tools/lldb-mi/TestMiInterrupt.py Tue Dec 30 11:11:31 2014
@@ -29,9 +29,6 @@ class MiInterruptTestCase(TestBase):
import pexpect
self.buildDefault()
- # The default lldb-mi prompt (seriously?!).
- prompt = "(gdb)"
-
# So that the child gets torn down after the test.
self.child = pexpect.spawn('%s --interpreter' % (self.lldbMiExec))
child = self.child
@@ -49,7 +46,6 @@ class MiInterruptTestCase(TestBase):
child.sendline("-break-insert -f main")
child.expect("\^done,bkpt={number=\"1\"")
child.sendline("-exec-run")
- child.sendline("") #FIXME: hangs here; extra return is needed
child.expect("\^running")
child.expect("\*stopped,reason=\"breakpoint-hit\"")
@@ -76,9 +72,6 @@ class MiInterruptTestCase(TestBase):
child.sendline("-exec-continue")
child.expect("\^running")
child.expect("\*stopped,reason=\"exited-normally\"")
- child.expect_exact(prompt)
-
- child.sendline("quit")
# Now that the necessary logging is done, restore logfile to None to
# stop further logging.
Modified: lldb/trunk/test/tools/lldb-mi/TestMiLaunch.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/TestMiLaunch.py?rev=224990&r1=224989&r2=224990&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/TestMiLaunch.py (original)
+++ lldb/trunk/test/tools/lldb-mi/TestMiLaunch.py Tue Dec 30 11:11:31 2014
@@ -28,9 +28,6 @@ class MiLaunchTestCase(TestBase):
import pexpect
self.buildDefault()
- # The default lldb-mi prompt (seriously?!).
- prompt = "(gdb)"
-
# So that the child gets torn down after the test.
self.child = pexpect.spawn('%s --interpreter' % (self.lldbMiExec))
child = self.child
@@ -46,12 +43,8 @@ class MiLaunchTestCase(TestBase):
child.expect("\^done")
child.sendline("-exec-run")
- child.sendline("") # FIXME: lldb-mi hangs here, so extra return is needed
child.expect("\^running")
child.expect("\*stopped,reason=\"exited-normally\"")
- child.expect_exact(prompt)
-
- child.sendline("quit")
# Now that the necessary logging is done, restore logfile to None to
# stop further logging.
@@ -74,9 +67,6 @@ class MiLaunchTestCase(TestBase):
import pexpect
self.buildDefault()
- # The default lldb-mi prompt (seriously?!).
- prompt = "(gdb)"
-
# So that the child gets torn down after the test.
self.child = pexpect.spawn('%s --interpreter' % (self.lldbMiExec))
child = self.child
@@ -93,12 +83,8 @@ class MiLaunchTestCase(TestBase):
child.expect("\^done")
child.sendline("-exec-run")
- child.sendline("") # FIXME: lldb-mi hangs here, so extra return is needed
child.expect("\^running")
child.expect("\*stopped,reason=\"exited-normally\"")
- child.expect_exact(prompt)
-
- child.sendline("quit")
# Now that the necessary logging is done, restore logfile to None to
# stop further logging.
@@ -121,9 +107,6 @@ class MiLaunchTestCase(TestBase):
import pexpect
self.buildDefault()
- # The default lldb-mi prompt (seriously?!).
- prompt = "(gdb)"
-
# So that the child gets torn down after the test.
self.child = pexpect.spawn('%s --interpreter' % (self.lldbMiExec))
child = self.child
@@ -140,12 +123,8 @@ class MiLaunchTestCase(TestBase):
child.expect("\^done")
child.sendline("-exec-run")
- child.sendline("") # FIXME: lldb-mi hangs here, so extra return is needed
child.expect("\^running")
child.expect("\*stopped,reason=\"exited-normally\"")
- child.expect_exact(prompt)
-
- child.sendline("quit")
# Now that the necessary logging is done, restore logfile to None to
# stop further logging.
@@ -168,9 +147,6 @@ class MiLaunchTestCase(TestBase):
import pexpect
self.buildDefault()
- # The default lldb-mi prompt (seriously?!).
- prompt = "(gdb)"
-
# So that the child gets torn down after the test.
self.child = pexpect.spawn('%s --interpreter' % (self.lldbMiExec))
child = self.child
@@ -185,9 +161,6 @@ class MiLaunchTestCase(TestBase):
exe = "badpath/" + self.myexe
child.sendline("-file-exec-and-symbols " + exe)
child.expect("\^error")
- #child.expect_exact(prompt) #FIXME: no prompt after error
-
- child.sendline("quit")
# Now that the necessary logging is done, restore logfile to None to
# stop further logging.
Modified: lldb/trunk/test/tools/lldb-mi/TestMiProgramArgs.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/TestMiProgramArgs.py?rev=224990&r1=224989&r2=224990&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/TestMiProgramArgs.py (original)
+++ lldb/trunk/test/tools/lldb-mi/TestMiProgramArgs.py Tue Dec 30 11:11:31 2014
@@ -29,9 +29,6 @@ class MiProgramArgsTestCase(TestBase):
import pexpect
self.buildDefault()
- # The default lldb-mi prompt (seriously?!).
- prompt = "(gdb)"
-
# So that the child gets torn down after the test.
self.child = pexpect.spawn('%s --interpreter' % (self.lldbMiExec))
child = self.child
@@ -52,7 +49,6 @@ class MiProgramArgsTestCase(TestBase):
child.sendline("-break-insert -f main")
child.expect("\^done,bkpt={number=\"1\"")
child.sendline("-exec-run")
- child.sendline("") #FIXME: hangs here; extra return is needed
child.expect("\^running")
child.expect("\*stopped,reason=\"breakpoint-hit\"")
@@ -68,8 +64,6 @@ class MiProgramArgsTestCase(TestBase):
child.expect("\^running")
child.expect("\*stopped,reason=\"breakpoint-hit\"")
- child.sendline("quit")
-
# Now that the necessary logging is done, restore logfile to None to
# stop further logging.
child.logfile_send = None
Modified: lldb/trunk/test/tools/lldb-mi/TestMiSyntax.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/TestMiSyntax.py?rev=224990&r1=224989&r2=224990&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/TestMiSyntax.py (original)
+++ lldb/trunk/test/tools/lldb-mi/TestMiSyntax.py Tue Dec 30 11:11:31 2014
@@ -28,9 +28,6 @@ class MiSyntaxTestCase(TestBase):
import pexpect
self.buildDefault()
- # The default lldb-mi prompt (seriously?!).
- prompt = "(gdb)"
-
# So that the child gets torn down after the test.
self.child = pexpect.spawn('%s --interpreter' % (self.lldbMiExec))
child = self.child
@@ -48,16 +45,12 @@ class MiSyntaxTestCase(TestBase):
child.expect("100000001\^done,bkpt={number=\"1\"")
child.sendline("2-exec-run")
- child.sendline("") # FIXME: lldb-mi hangs here, so extra return is needed
child.expect("2\^running")
child.expect("\*stopped,reason=\"breakpoint-hit\"")
child.sendline("0000000000000000000003-exec-continue")
child.expect("0000000000000000000003\^running")
child.expect("\*stopped,reason=\"exited-normally\"")
- child.expect_exact(prompt)
-
- child.sendline("quit")
# Now that the necessary logging is done, restore logfile to None to
# stop further logging.
@@ -74,10 +67,6 @@ class MiSyntaxTestCase(TestBase):
print "\n\nContents of child_read.txt:"
print from_child
- self.expect(from_child, exe=False,
- substrs = ["breakpoint-hit"])
-
-
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
More information about the lldb-commits
mailing list