Files
llvm-project/lldb/test/API/lang/cpp/call-function/TestCallCPPFunction.py
Jonas Devlieghere 88d2615129 [lldb] Add skipIfWasm decorator and skip unsupported WebAssembly tests (#194761)
Add a new `skipIfWasm` test decorator that skips tests on the "wasip1"
and "wasi" platforms, and apply it to the test classes that rely on
expression evaluation or lldb-server, neither of which is available when
debugging WebAssembly targets.
2026-04-29 09:59:01 -07:00

32 lines
899 B
Python

"""
Tests calling a function by basename
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
@skipIfWasm # no expression evaluation
class CallCPPFunctionTestCase(TestBase):
def setUp(self):
TestBase.setUp(self)
self.line = line_number("main.cpp", "// breakpoint")
def test_with_run_command(self):
"""Test calling a function by basename"""
self.build()
lldbutil.run_to_source_breakpoint(
self, "// breakpoint", lldb.SBFileSpec("main.cpp")
)
# The stop reason of the thread should be breakpoint.
self.expect(
"thread list",
STOPPED_DUE_TO_BREAKPOINT,
substrs=["stopped", "stop reason = breakpoint"],
)
self.expect_expr("a_function_to_call()", result_type="int", result_value="0")