2 Test that the po command acts correctly.
5 from __future__ import print_function
10 import lldbsuite.test.lldbutil as lldbutil
11 from lldbsuite.test.lldbtest import *
13 class PoVerbosityTestCase(TestBase):
15 mydir = TestBase.compute_mydir(__file__)
18 # Call super's setUp().
20 # Find the line number to break for main.cpp.
21 self.line = line_number('main.m',
26 """Test that the po command acts correctly."""
29 # This is the function to remove the custom formats in order to have a
30 # clean slate for the next test case.
32 self.runCmd('type summary clear', check=False)
33 self.runCmd('type synthetic clear', check=False)
35 # Execute the cleanup function during test case tear down.
36 self.addTearDownHook(cleanup)
38 """Test expr + formatters for good interoperability."""
39 self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
41 lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, loc_exact=True)
43 self.runCmd("run", RUN_SUCCEEDED)
45 self.expect("expr -O -v -- foo",
46 substrs = ['(id) $',' = 0x', '1 = 2','2 = 3;'])
47 self.expect("expr -O -vfull -- foo",
48 substrs = ['(id) $',' = 0x', '1 = 2','2 = 3;'])
49 self.expect("expr -O -- foo",matching=False,
52 self.expect("expr -O -- 22",matching=False,
53 substrs = ['(int) $'])
54 self.expect("expr -O -- 22",
57 self.expect("expr -O -vfull -- 22",
58 substrs = ['(int) $', ' = 22'])
60 self.expect("expr -O -v -- 22",
61 substrs = ['(int) $', ' = 22'])