2 Test that plugins that load commands work correctly.
5 from __future__ import print_function
12 from lldbsuite.test.lldbtest import *
13 import lldbsuite.test.lldbutil as lldbutil
15 class PluginCommandTestCase(TestBase):
17 mydir = TestBase.compute_mydir(__file__)
20 @skipIfHostIncompatibleWithRemote # Requires a compatible arch and platform to link against the host's built lldb lib.
21 @expectedFailureWindows("llvm.org/pr24778")
23 def test_load_plugin(self):
24 """Test that plugins that load commands work correctly."""
26 plugin_name = "plugin"
27 if sys.platform.startswith("darwin"):
28 plugin_lib_name = "lib%s.dylib" % plugin_name
30 plugin_lib_name = "lib%s.so" % plugin_name
32 # Invoke the library build rule.
33 self.buildLibrary("plugin.cpp", plugin_name)
35 debugger = lldb.SBDebugger.Create()
37 retobj = lldb.SBCommandReturnObject()
39 retval = debugger.GetCommandInterpreter().HandleCommand("plugin load %s" % plugin_lib_name, retobj)
43 retval = debugger.GetCommandInterpreter().HandleCommand("plugin_loaded_command child abc def ghi",retobj)
46 print(retobj.GetOutput())
48 self.expect(retobj,substrs = ['abc def ghi'], exe=False)
52 # check that abbreviations work correctly in plugin commands.
53 retval = debugger.GetCommandInterpreter().HandleCommand("plugin_loaded_ ch abc def ghi",retobj)
56 print(retobj.GetOutput())
58 self.expect(retobj,substrs = ['abc def ghi'], exe=False)