2 Test that the 'gui' displays the help window and basic UI.
6 from lldbsuite
.test
.decorators
import *
7 from lldbsuite
.test
.lldbtest
import *
8 from lldbsuite
.test
.lldbpexpect
import PExpectTest
10 class BasicGuiCommandTest(PExpectTest
):
12 mydir
= TestBase
.compute_mydir(__file__
)
14 # PExpect uses many timeouts internally and doesn't play well
15 # under ASAN on a loaded machine..
17 @skipIfCursesSupportMissing
18 @skipIfRemote # "run" command will not work correctly for remote debug
22 self
.launch(executable
=self
.getBuildArtifact("a.out"), dimensions
=(100,500))
23 self
.expect('br set -f main.c -p "// Break here"', substrs
=["Breakpoint 1", "address ="])
24 self
.expect("run", substrs
=["stop reason ="])
27 escape_key
= chr(27).encode()
29 # Start the GUI for the first time and check for the welcome window.
30 self
.child
.sendline("gui")
31 self
.child
.expect_exact("Welcome to the LLDB curses GUI.")
33 # Press escape to quit the welcome screen
34 self
.child
.send(escape_key
)
35 # Press escape again to quit the gui
36 self
.child
.send(escape_key
)
39 # Start the GUI a second time, this time we should have the normal GUI.
40 self
.child
.sendline("gui")
41 # Check for GUI elements in the menu bar.
42 self
.child
.expect_exact("Target")
43 self
.child
.expect_exact("Process")
44 self
.child
.expect_exact("Thread")
45 self
.child
.expect_exact("View")
46 self
.child
.expect_exact("Help")
48 # Check the sources window.
49 self
.child
.expect_exact("Sources")
50 self
.child
.expect_exact("main")
51 self
.child
.expect_exact("funky_var_name_that_should_be_rendered")
53 # Check the variable window.
54 self
.child
.expect_exact("Variables")
55 self
.child
.expect_exact("(int) funky_var_name_that_should_be_rendered = 22")
57 # Check the bar at the bottom.
58 self
.child
.expect_exact("Frame:")
60 # Press escape to quit the gui
61 self
.child
.send(escape_key
)