2 Test that the po command acts correctly.
5 from __future__ import print_function
10 from lldbsuite.test.decorators import *
11 from lldbsuite.test.lldbtest import *
12 from lldbsuite.test import lldbutil
14 class PoVerbosityTestCase(TestBase):
16 mydir = TestBase.compute_mydir(__file__)
19 # Call super's setUp().
21 # Find the line number to break for main.cpp.
22 self.line = line_number('main.m',
27 """Test that the po command acts correctly."""
30 # This is the function to remove the custom formats in order to have a
31 # clean slate for the next test case.
33 self.runCmd('type summary clear', check=False)
34 self.runCmd('type synthetic clear', check=False)
36 # Execute the cleanup function during test case tear down.
37 self.addTearDownHook(cleanup)
39 """Test expr + formatters for good interoperability."""
40 self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
42 lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, loc_exact=True)
44 self.runCmd("run", RUN_SUCCEEDED)
46 self.expect("expr -O -v -- foo",
47 substrs = ['(id) $',' = 0x', '1 = 2','2 = 3;'])
48 self.expect("expr -O -vfull -- foo",
49 substrs = ['(id) $',' = 0x', '1 = 2','2 = 3;'])
50 self.expect("expr -O -- foo",matching=False,
53 self.expect("expr -O -- 22",matching=False,
54 substrs = ['(int) $'])
55 self.expect("expr -O -- 22",
58 self.expect("expr -O -vfull -- 22",
59 substrs = ['(int) $', ' = 22'])
61 self.expect("expr -O -v -- 22",
62 substrs = ['(int) $', ' = 22'])