Files
clang-p2996/lldb/test/API/commands/plugin/TestPlugin.py
David Peixotto c677a11c8d [lldb] Add support to list/enable/disable remaining plugin types. (#143970)
In #134418 we added support to list/enable/disable `SystemRuntime` and
`InstrumentationRuntime` plugins. We limited it to those two plugin
types to flesh out the idea with a smaller change.

This PR adds support for the remaining plugin types. We now support all
the plugins that can be registered directly with the plugin manager.
Plugins that are added by loading shared objects are still not
supported.
2025-06-17 13:47:20 -07:00

63 lines
1.9 KiB
Python

"""
Make sure the plugin list, enable, and disable commands work.
"""
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
class TestFrameVar(TestBase):
# If your test case doesn't stress debug info, then
# set this to true. That way it won't be run once for
# each debug info format.
NO_DEBUG_INFO_TESTCASE = True
def test_plugin_list_enable_disable_commands(self):
for plugin_namespace in [
"abi",
"architecture",
"disassembler",
"dynamic-loader",
"emulate-instruction",
"instrumentation-runtime",
"jit-loader",
"language",
"language-runtime",
"memory-history",
"object-container",
"object-file",
"operating-system",
"platform",
"process",
"repl",
"register-type-builder",
"script-interpreter",
"scripted-interface",
"structured-data",
"symbol-file",
"symbol-locator",
"symbol-vendor",
"system-runtime",
# 'trace', # No trace plugin is registered by default.
"trace-exporter",
"type-system",
"unwind-assembly",
]:
self.do_list_disable_enable_test(plugin_namespace)
def do_list_disable_enable_test(self, plugin_namespace):
# Plugins are enabled by default.
self.expect(
f"plugin list {plugin_namespace}", substrs=[plugin_namespace, "[+]"]
)
# Plugins can be disabled.
self.expect(
f"plugin disable {plugin_namespace}", substrs=[plugin_namespace, "[-]"]
)
# Plugins can be enabled.
self.expect(
f"plugin enable {plugin_namespace}", substrs=[plugin_namespace, "[+]"]
)