2 Test that the po command acts correctly.
7 from lldbsuite
.test
.decorators
import *
8 from lldbsuite
.test
.lldbtest
import *
9 from lldbsuite
.test
import lldbutil
12 class PoVerbosityTestCase(TestBase
):
14 # Call super's setUp().
16 # Find the line number to break for main.cpp.
17 self
.line
= line_number("main.m", "// Stop here")
19 @add_test_categories(["objc"])
21 """Test that the po command acts correctly."""
24 # This is the function to remove the custom formats in order to have a
25 # clean slate for the next test case.
27 self
.runCmd("type summary clear", check
=False)
28 self
.runCmd("type synthetic clear", check
=False)
30 # Execute the cleanup function during test case tear down.
31 self
.addTearDownHook(cleanup
)
33 """Test expr + formatters for good interoperability."""
34 self
.runCmd("file " + self
.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET
)
36 lldbutil
.run_break_set_by_file_and_line(
37 self
, "main.m", self
.line
, loc_exact
=True
40 self
.runCmd("run", RUN_SUCCEEDED
)
42 self
.runCmd("settings set target.prefer-dynamic-value no-dynamic-values")
44 self
.expect("expr -O -v -- foo", substrs
=["(id) $", " = 0x", "1 = 2", "2 = 3;"])
46 "expr -O -vfull -- foo", substrs
=["(id) $", " = 0x", "1 = 2", "2 = 3;"]
48 self
.expect("expr -O -- foo", matching
=False, substrs
=["(id) $"])
50 self
.expect("expr -O -- 22", matching
=False, substrs
=["(int) $"])
51 self
.expect("expr -O -- 22", substrs
=["22"])
53 self
.expect("expr -O -vfull -- 22", substrs
=["(int) $", " = 22"])
55 self
.expect("expr -O -v -- 22", substrs
=["(int) $", " = 22"])