2 Test lldb data formatter subsystem.
6 from lldbsuite
.test
.decorators
import *
7 from lldbsuite
.test
.lldbbench
import *
8 from lldbsuite
.test
.lldbtest
import *
9 from lldbsuite
.test
import lldbutil
12 class TestBenchmarkLibcxxList(BenchBase
):
14 def test_run_command(self
):
15 """Benchmark the std::list data formatter (libc++)"""
17 self
.data_formatter_commands()
20 # Call super's setUp().
23 def data_formatter_commands(self
):
24 """Benchmark the std::list data formatter (libc++)"""
25 self
.runCmd("file " + self
.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET
)
27 bkpt
= self
.target().FindBreakpointByID(
28 lldbutil
.run_break_set_by_source_regexp(self
, "break here")
31 self
.runCmd("run", RUN_SUCCEEDED
)
33 # The stop reason of the thread should be breakpoint.
36 STOPPED_DUE_TO_BREAKPOINT
,
37 substrs
=["stopped", "stop reason = breakpoint"],
40 # This is the function to remove the custom formats in order to have a
41 # clean slate for the next test case.
43 self
.runCmd("type format clear", check
=False)
44 self
.runCmd("type summary clear", check
=False)
45 self
.runCmd("type filter clear", check
=False)
46 self
.runCmd("type synth clear", check
=False)
47 self
.runCmd("settings set target.max-children-count 256", check
=False)
49 # Execute the cleanup function during test case tear down.
50 self
.addTearDownHook(cleanup
)
55 self
.expect("frame variable -A list", substrs
=["[300]", "300"])
58 print("time to print: %s" % (sw
))