2 Test lldb data formatter subsystem.
5 from __future__ import print_function
11 from lldbsuite.test.lldbbench import *
12 import lldbsuite.test.lldbutil as lldbutil
14 class TestBenchmarkLibcxxList(BenchBase):
16 mydir = TestBase.compute_mydir(__file__)
19 def test_run_command(self):
20 """Benchmark the std::list data formatter (libc++)"""
22 self.data_formatter_commands()
25 # Call super's setUp().
28 def data_formatter_commands(self):
29 """Benchmark the std::list data formatter (libc++)"""
30 self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
32 bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "break here"))
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 filter clear', check=False)
47 self.runCmd('type synth clear', check=False)
48 self.runCmd("settings set target.max-children-count 256", check=False)
50 # Execute the cleanup function during test case tear down.
51 self.addTearDownHook(cleanup)
56 self.expect('frame variable -A list', substrs=['[300]', '300'])
59 print("time to print: %s" % (sw))