3 Test lldb data formatter subsystem.
9 from lldbsuite.test.decorators import *
10 from lldbsuite.test.lldbtest import *
11 from lldbsuite.test import lldbutil
14 class NSIndexPathDataFormatterTestCase(TestBase):
16 mydir = TestBase.compute_mydir(__file__)
18 def appkit_tester_impl(self, commands):
20 self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
22 lldbutil.run_break_set_by_file_and_line(
23 self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
25 self.runCmd("run", RUN_SUCCEEDED)
27 # The stop reason of the thread should be breakpoint.
28 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
30 'stop reason = breakpoint'])
32 # This is the function to remove the custom formats in order to have a
33 # clean slate for the next test case.
35 self.runCmd('type format clear', check=False)
36 self.runCmd('type summary clear', check=False)
37 self.runCmd('type synth clear', check=False)
39 # Execute the cleanup function during test case tear down.
40 self.addTearDownHook(cleanup)
44 @expectedFailureAll(archs=['i386'], bugnumber="rdar://28656605")
45 @expectedFailureAll(archs=['armv7', 'armv7k', 'arm64_32'], bugnumber="rdar://problem/34561607") # NSIndexPath formatter isn't working for 32-bit arm
46 def test_nsindexpath_with_run_command(self):
47 """Test formatters for NSIndexPath."""
48 self.appkit_tester_impl(self.nsindexpath_data_formatter_commands)
51 # Call super's setUp().
53 # Find the line number to break at.
54 self.line = line_number('main.m', '// break here')
56 def nsindexpath_data_formatter_commands(self):
57 # check 'frame variable'
59 'frame variable --ptr-depth=1 -d run -- indexPath1',
62 'frame variable --ptr-depth=1 -d run -- indexPath2',
67 'frame variable --ptr-depth=1 -d run -- indexPath3',
73 'frame variable --ptr-depth=1 -d run -- indexPath4',
80 'frame variable --ptr-depth=1 -d run -- indexPath5',
90 'expression --ptr-depth=1 -d run -- indexPath1',
93 'expression --ptr-depth=1 -d run -- indexPath2',
98 'expression --ptr-depth=1 -d run -- indexPath3',
103 self.expect('expression --ptr-depth=1 -d run -- indexPath4',
104 substrs=['[0] = 1', '[1] = 2', '[2] = 3', '[3] = 4'])
106 'expression --ptr-depth=1 -d run -- indexPath5',