55 lines · python
1"""2Test that the 'gui' displays the help window and basic UI.3"""4 5import lldb6from lldbsuite.test.decorators import *7from lldbsuite.test.lldbtest import *8from lldbsuite.test.lldbpexpect import PExpectTest9 10 11class BasicGuiCommandTest(PExpectTest):12 # PExpect uses many timeouts internally and doesn't play well13 # under ASAN on a loaded machine..14 @skipIfAsan15 @skipIfCursesSupportMissing16 @skipIf(oslist=["linux"], archs=["arm$", "aarch64"])17 def test_gui(self):18 self.build()19 20 self.launch(executable=self.getBuildArtifact("a.out"), dimensions=(100, 500))21 self.expect(22 'br set -f main.c -p "// Break here"', substrs=["Breakpoint 1", "address ="]23 )24 self.expect("run", substrs=["stop reason ="])25 26 escape_key = chr(27).encode()27 28 # Start the GUI.29 self.child.sendline("gui")30 31 # Check for GUI elements in the menu bar.32 self.child.expect_exact("Target")33 self.child.expect_exact("Process")34 self.child.expect_exact("Thread")35 self.child.expect_exact("View")36 self.child.expect_exact("Help")37 38 # Check the sources window.39 self.child.expect_exact("Sources")40 self.child.expect_exact("main")41 self.child.expect_exact("funky_var_name_that_should_be_rendered")42 43 # Check the variable window.44 self.child.expect_exact("Variables")45 self.child.expect_exact("(int) funky_var_name_that_should_be_rendered = 22")46 47 # Check the bar at the bottom.48 self.child.expect_exact("Frame:")49 50 # Press escape to quit the gui51 self.child.send(escape_key)52 53 self.expect_prompt()54 self.quit()55