• Home
  • 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    mydir = TestBase.compute_mydir(__file__)
15
16    @no_debug_info_test
17    def test_quit_exit_code_disallow(self):
18        self.ci.AllowExitCodeOnQuit(False)
19        self.expect(
20            "quit 20",
21            substrs=[
22                "error: The current driver doesn't allow custom exit codes for the quit command"],
23            error=True)
24        self.assertFalse(self.ci.HasCustomQuitExitCode())
25
26    @no_debug_info_test
27    def test_quit_exit_code_allow(self):
28        self.ci.AllowExitCodeOnQuit(True)
29        self.runCmd("quit 10", check=False)
30        self.assertTrue(self.ci.HasCustomQuitExitCode())
31        self.assertEqual(self.ci.GetQuitStatus(), 10)
32