• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2import unittest2
3import lldb
4from lldbsuite.test.lldbtest import *
5import lldbsuite.test.lldbutil as lldbutil
6from lldbsuite.test.decorators import *
7
8class TestPreRunLibraries(TestBase):
9
10    mydir = TestBase.compute_mydir(__file__)
11    NO_DEBUG_INFO_TESTCASE = True
12
13    @skipIf(oslist=no_match(['darwin','macos']))
14    def test(self):
15        """Test that we find directly linked dylib pre-run."""
16
17        self.build()
18        target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
19        self.assertTrue(target, VALID_TARGET)
20
21        # I don't know what the name of a shared library
22        # extension is in general, so instead of using FindModule,
23        # I'll iterate through the module and do a basename match.
24        found_it = False
25        for module in target.modules:
26            file_name = module.GetFileSpec().GetFilename()
27            if file_name.find("unlikely_name") != -1:
28                found_it = True
29                break
30
31        self.assertTrue(found_it, "Couldn't find unlikely_to_occur_name in loaded libraries.")
32
33
34