brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1019 B · a21ec1e Raw
31 lines · python
1import lldb2from lldbsuite.test.lldbtest import *3import lldbsuite.test.lldbutil as lldbutil4from lldbsuite.test.decorators import *5 6 7class TestPreRunLibraries(TestBase):8    NO_DEBUG_INFO_TESTCASE = True9 10    @skipIf(oslist=no_match(["darwin", "macos"]))11    def test(self):12        """Test that we find directly linked dylib pre-run."""13 14        self.build()15        target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))16        self.assertTrue(target, VALID_TARGET)17 18        # I don't know what the name of a shared library19        # extension is in general, so instead of using FindModule,20        # I'll iterate through the module and do a basename match.21        found_it = False22        for module in target.modules:23            file_name = module.GetFileSpec().GetFilename()24            if file_name.find("unlikely_name") != -1:25                found_it = True26                break27 28        self.assertTrue(29            found_it, "Couldn't find unlikely_to_occur_name in loaded libraries."30        )31