31 lines · python
1"""2Test lldb's quit command.3"""4 5 6import lldb7from lldbsuite.test.decorators import *8from lldbsuite.test.lldbtest import *9from lldbsuite.test import lldbutil10 11 12class QuitCommandTestCase(TestBase):13 @no_debug_info_test14 def test_quit_exit_code_disallow(self):15 self.ci.AllowExitCodeOnQuit(False)16 self.expect(17 "quit 20",18 substrs=[19 "error: The current driver doesn't allow custom exit codes for the quit command"20 ],21 error=True,22 )23 self.assertFalse(self.ci.HasCustomQuitExitCode())24 25 @no_debug_info_test26 def test_quit_exit_code_allow(self):27 self.ci.AllowExitCodeOnQuit(True)28 self.runCmd("quit 10", check=False)29 self.assertTrue(self.ci.HasCustomQuitExitCode())30 self.assertEqual(self.ci.GetQuitStatus(), 10)31