xref: /llvm-project-15.0.7/lldb/test/API/commands/quit/TestQuit.py (revision d3cbcc4e)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1"""
2Test lldb's quit command.
3"""
4
5
6import lldb
7from lldbsuite.test.decorators import *
8from lldbsuite.test.lldbtest import *
9from lldbsuite.test import lldbutil
10
11
12class QuitCommandTestCase(TestBase):
13
14    @no_debug_info_test
15    def test_quit_exit_code_disallow(self):
16        self.ci.AllowExitCodeOnQuit(False)
17        self.expect(
18            "quit 20",
19            substrs=[
20                "error: The current driver doesn't allow custom exit codes for the quit command"],
21            error=True)
22        self.assertFalse(self.ci.HasCustomQuitExitCode())
23
24    @no_debug_info_test
25    def test_quit_exit_code_allow(self):
26        self.ci.AllowExitCodeOnQuit(True)
27        self.runCmd("quit 10", check=False)
28        self.assertTrue(self.ci.HasCustomQuitExitCode())
29        self.assertEqual(self.ci.GetQuitStatus(), 10)
30

served by {OpenGrok

Last Index Update: Fri May 15 20:09:11 GMT 2026