Some tests set settings and don't clean them up, this leads to side effects in other tests. The patch removes a global debugger instance with a per-test debugger to avoid such effects. From what I see, lldb.DBG was needed to determine the platform before a test is run, lldb.selected_platform is used for this purpose now. Though, this required adding a new function to the SBPlatform interface. Differential Revision: https://reviews.llvm.org/D74903
31 lines
750 B
Python
31 lines
750 B
Python
"""
|
|
Test loading of a kext binary.
|
|
"""
|
|
|
|
|
|
|
|
import lldb
|
|
from lldbsuite.test.decorators import *
|
|
from lldbsuite.test.lldbtest import *
|
|
from lldbsuite.test import lldbutil
|
|
|
|
|
|
class LoadKextTestCase(TestBase):
|
|
NO_DEBUG_INFO_TESTCASE = True
|
|
|
|
mydir = TestBase.compute_mydir(__file__)
|
|
|
|
def test_load_kext(self):
|
|
"""Test that lldb can load a kext binary."""
|
|
|
|
# Create kext from YAML.
|
|
self.yaml2obj("mykext.yaml", self.getBuildArtifact("mykext"))
|
|
|
|
target = self.dbg.CreateTarget(self.getBuildArtifact("mykext"))
|
|
|
|
self.assertTrue(target.IsValid())
|
|
|
|
self.assertEqual(target.GetNumModules(), 1)
|
|
mod = target.GetModuleAtIndex(0)
|
|
self.assertEqual(mod.GetFileSpec().GetFilename(), "mykext")
|