2 Test lldb data formatter subsystem.
5 from __future__ import print_function
11 from lldbsuite.test.lldbbench import *
12 from lldbsuite.test.decorators import *
13 from lldbsuite.test.lldbtest import *
14 from lldbsuite.test import lldbutil
17 class TestBenchmarkLibcxxMap(BenchBase):
19 mydir = TestBase.compute_mydir(__file__)
22 def test_run_command(self):
23 """Benchmark the std::map data formatter (libc++)"""
25 self.data_formatter_commands()
28 # Call super's setUp().
31 def data_formatter_commands(self):
32 """Benchmark the std::map data formatter (libc++)"""
33 self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
35 bkpt = self.target().FindBreakpointByID(
36 lldbutil.run_break_set_by_source_regexp(
39 self.runCmd("run", RUN_SUCCEEDED)
41 # The stop reason of the thread should be breakpoint.
42 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
44 'stop reason = breakpoint'])
46 # This is the function to remove the custom formats in order to have a
47 # clean slate for the next test case.
49 self.runCmd('type format clear', check=False)
50 self.runCmd('type summary clear', check=False)
51 self.runCmd('type filter clear', check=False)
52 self.runCmd('type synth clear', check=False)
54 "settings set target.max-children-count 256",
57 # Execute the cleanup function during test case tear down.
58 self.addTearDownHook(cleanup)
63 self.expect('frame variable -A map', substrs=['[300]', '300'])
66 print("time to print: %s" % (sw))