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
16 class DataFormatterOSTypeTestCase(TestBase):
18 mydir = TestBase.compute_mydir(__file__)
21 # Call super's setUp().
23 # Find the line number to break at.
24 self.line = line_number('main.mm', '// Set break point at this line.')
27 def test_ostype_with_run_command(self):
28 """Test the formatters we use for OSType."""
30 self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
32 lldbutil.run_break_set_by_file_and_line (self, "main.mm", self.line, num_expected_locations=1, loc_exact=True)
34 self.runCmd("run", RUN_SUCCEEDED)
36 # The stop reason of the thread should be breakpoint.
37 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
39 'stop reason = breakpoint'])
41 # This is the function to remove the custom formats in order to have a
42 # clean slate for the next test case.
44 self.runCmd('type format clear', check=False)
45 self.runCmd('type summary clear', check=False)
46 self.runCmd('type synth clear', check=False)
48 # Execute the cleanup function during test case tear down.
49 self.addTearDownHook(cleanup)
51 # Now check that we use the right summary for OSType
52 self.expect('frame variable',
53 substrs = ["'test'","'best'"])