Files
clang-p2996/lldb/test/API/python_api/sbvalue_synthetic/TestSBValueSynthetic.py
Pavel Labath 3068d277fd [lldb] Fix TestSBValueSynthetic on windows (#75908)
We don't have a std::vector formatter on windows, so use a custom
formatter in this test to avoid relying on std::vector.
2023-12-19 09:58:25 +01:00

24 lines
794 B
Python

import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestSBValueSynthetic(TestBase):
NO_DEBUG_INFO_TESTCASE = True
def test_str(self):
self.build()
lldbutil.run_to_source_breakpoint(
self, "break here", lldb.SBFileSpec("main.cpp")
)
self.runCmd("command script import formatter.py")
self.runCmd(
"type synthetic add --python-class formatter.FooSyntheticProvider Foo"
)
formatted = self.frame().FindVariable("foo")
has_formatted = self.frame().FindVariable("has_foo")
self.expect(str(formatted), exe=False, substrs=["synth_child"])
self.expect(str(has_formatted), exe=False, substrs=["synth_child"])