2 Test lldb data formatter subsystem.
8 from lldbsuite.test.decorators import *
9 from lldbsuite.test.lldbtest import *
10 from lldbsuite.test import lldbutil
13 class DataFormatterDisablingTestCase(TestBase):
15 mydir = TestBase.compute_mydir(__file__)
18 # Call super's setUp().
20 # Find the line number to break at.
21 self.line = line_number('main.cpp', '// Set break point at this line.')
25 bugnumber="llvm.org/pr24462, Data formatters have problems on Windows")
26 def test_with_run_command(self):
27 """Check that we can properly disable all data formatter categories."""
29 self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
31 lldbutil.run_break_set_by_file_and_line(
32 self, "main.cpp", 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 category enable *', check=False)
46 # Execute the cleanup function during test case tear down.
47 self.addTearDownHook(cleanup)
49 #self.runCmd('type category enable system VectorTypes libcxx gnu-libstdc++ CoreGraphics CoreServices AppKit CoreFoundation objc default', check=False)
51 self.expect('type category list', substrs=['system', 'enabled', ])
53 self.expect("frame variable numbers",
54 substrs=['[0] = 1', '[3] = 1234'])
56 self.expect('frame variable string1', substrs=['hello world'])
58 # now disable them all and check that nothing is formatted
59 self.runCmd('type category disable *')
61 self.expect("frame variable numbers", matching=False,
62 substrs=['[0] = 1', '[3] = 1234'])
65 'frame variable string1',
67 substrs=['hello world'])
69 self.expect('type summary list', substrs=[
70 'Category: system (disabled)'])
72 self.expect('type category list', substrs=['system', 'disabled', ])
74 # now enable and check that we are back to normal
75 self.runCmd("type category enable *")
77 self.expect('type category list', substrs=['system', 'enabled'])
79 self.expect("frame variable numbers",
80 substrs=['[0] = 1', '[3] = 1234'])
82 self.expect('frame variable string1', substrs=['hello world'])
84 self.expect('type category list', substrs=['system', 'enabled'])
86 # last check - our cleanup will re-enable everything
87 self.runCmd('type category disable *')
88 self.expect('type category list', substrs=['system', 'disabled'])