2 Test lldb data formatter subsystem.
5 from __future__ import print_function
11 from lldbsuite.test.lldbtest import *
12 import lldbsuite.test.lldbutil as lldbutil
14 class DataFormatterDisablingTestCase(TestBase):
16 mydir = TestBase.compute_mydir(__file__)
19 # Call super's setUp().
21 # Find the line number to break at.
22 self.line = line_number('main.cpp', '// Set break point at this line.')
24 @expectedFailureWindows("llvm.org/pr24462") # Data formatters have problems on Windows
25 def test_with_run_command(self):
26 """Check that we can properly disable all data formatter categories."""
28 self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
30 lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
32 self.runCmd("run", RUN_SUCCEEDED)
34 # The stop reason of the thread should be breakpoint.
35 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
37 'stop reason = breakpoint'])
39 # This is the function to remove the custom formats in order to have a
40 # clean slate for the next test case.
42 self.runCmd('type category enable *', check=False)
44 # Execute the cleanup function during test case tear down.
45 self.addTearDownHook(cleanup)
47 #self.runCmd('type category enable system VectorTypes libcxx gnu-libstdc++ CoreGraphics CoreServices AppKit CoreFoundation objc default', check=False)
49 self.expect('type category list', substrs = ['system','enabled',])
51 self.expect("frame variable numbers",
52 substrs = ['[0] = 1', '[3] = 1234'])
54 self.expect('frame variable string1', substrs = ['hello world'])
56 # now disable them all and check that nothing is formatted
57 self.runCmd('type category disable *')
59 self.expect("frame variable numbers", matching=False,
60 substrs = ['[0] = 1', '[3] = 1234'])
62 self.expect('frame variable string1', matching=False, substrs = ['hello world'])
64 self.expect('type category list', substrs = ['system','disabled',])
66 # now enable and check that we are back to normal
67 self.runCmd("type category enable *")
69 self.expect('type category list', substrs = ['system','enabled'])
71 self.expect("frame variable numbers",
72 substrs = ['[0] = 1', '[3] = 1234'])
74 self.expect('frame variable string1', substrs = ['hello world'])
76 self.expect('type category list', substrs = ['system','enabled'])
78 # last check - our cleanup will re-enable everything
79 self.runCmd('type category disable *')
80 self.expect('type category list', substrs = ['system','disabled'])