From 9e6d35490a6542f9c97607f93c2ef8ca8e03cbcc Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 6 Jan 2016 20:12:03 +0000 Subject: Vendor import of lldb trunk r256945: https://llvm.org/svn/llvm-project/lldb/trunk@256945 --- .../lldbsuite/test/tools/lldb-mi/TestMiExit.py | 84 ++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 packages/Python/lldbsuite/test/tools/lldb-mi/TestMiExit.py (limited to 'packages/Python/lldbsuite/test/tools/lldb-mi/TestMiExit.py') diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiExit.py b/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiExit.py new file mode 100644 index 0000000000000..86a0a65b05a77 --- /dev/null +++ b/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiExit.py @@ -0,0 +1,84 @@ +""" +Test that the lldb-mi driver exits properly. +""" + +from __future__ import print_function + + + +import lldbmi_testcase +from lldbsuite.test.lldbtest import * + +class MiExitTestCase(lldbmi_testcase.MiTestCaseBase): + + mydir = TestBase.compute_mydir(__file__) + + @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") + @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races + def test_lldbmi_gdb_exit(self): + """Test that '-gdb-exit' terminates local debug session and exits.""" + + self.spawnLldbMi(args = None) + + # Load executable + self.runCmd("-file-exec-and-symbols %s" % self.myexe) + self.expect("\^done") + + # Run to main + self.runCmd("-break-insert -f main") + self.expect("\^done,bkpt={number=\"1\"") + self.runCmd("-exec-run") + self.expect("\^running") + self.expect("\*stopped,reason=\"breakpoint-hit\"") + + # Test -gdb-exit: try to exit and check that program is finished + self.runCmd("-gdb-exit") + self.expect("\^exit") + import pexpect + self.expect(pexpect.EOF) + + @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") + @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races + def test_lldbmi_quit(self): + """Test that 'quit' exits immediately.""" + + self.spawnLldbMi(args = None) + + # Load executable + self.runCmd("-file-exec-and-symbols %s" % self.myexe) + self.expect("\^done") + + # Run to main + self.runCmd("-break-insert -f main") + self.expect("\^done,bkpt={number=\"1\"") + self.runCmd("-exec-run") + self.expect("\^running") + self.expect("\*stopped,reason=\"breakpoint-hit\"") + + # Test quit: try to exit and check that program is finished + self.runCmd("quit") + import pexpect + self.expect(pexpect.EOF) + + @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") + @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races + def test_lldbmi_q(self): + """Test that 'q' exits immediately.""" + + self.spawnLldbMi(args = None) + + # Load executable + self.runCmd("-file-exec-and-symbols %s" % self.myexe) + self.expect("\^done") + + # Run to main + self.runCmd("-break-insert -f main") + self.expect("\^done,bkpt={number=\"1\"") + self.runCmd("-exec-run") + self.expect("\^running") + self.expect("\*stopped,reason=\"breakpoint-hit\"") + + # Test q: try to exit and check that program is finished + self.runCmd("q") + import pexpect + self.expect(pexpect.EOF) -- cgit v1.2.3