2 Test lldb data formatter subsystem.
5 from __future__ import print_function
12 from lldbsuite.test.decorators import *
13 from lldbsuite.test.lldbtest import *
14 from lldbsuite.test import lldbutil
17 class PrintObjectArrayTestCase(TestBase):
19 mydir = TestBase.compute_mydir(__file__)
22 def test_print_array(self):
23 """Test that expr -O -Z works"""
25 self.printarray_data_formatter_commands()
28 # Call super's setUp().
30 # Find the line number to break at.
31 self.line = line_number('main.mm', 'break here')
33 def printarray_data_formatter_commands(self):
34 """Test that expr -O -Z works"""
35 self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
37 lldbutil.run_break_set_by_file_and_line(
38 self, "main.mm", self.line, num_expected_locations=1, loc_exact=True)
40 self.runCmd("run", RUN_SUCCEEDED)
42 # The stop reason of the thread should be breakpoint.
43 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
45 'stop reason = breakpoint'])
47 # This is the function to remove the custom formats in order to have a
48 # clean slate for the next test case.
50 self.runCmd('type format clear', check=False)
51 self.runCmd('type summary clear', check=False)
52 self.runCmd('type synth clear', check=False)
54 # Execute the cleanup function during test case tear down.
55 self.addTearDownHook(cleanup)
58 'expr --element-count 3 --object-description -- objects',
78 'expr --element-count 3 --object-description --description-verbosity=full -- objects',
97 'expr --element-count 3 -d run -- objects',
101 '2 key/value pairs'])
103 'expr --element-count 3 -d run --ptr-depth=1 -- objects',