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 NO_DEBUG_INFO_TESTCASE = True 10 11 @skipIf(oslist=no_match(['darwin','macos'])) 12 def test(self): 13 """Test that we find directly linked dylib pre-run.""" 14 15 self.build() 16 target = self.dbg.CreateTarget(self.getBuildArtifact("a.out")) 17 self.assertTrue(target, VALID_TARGET) 18 19 # I don't know what the name of a shared library 20 # extension is in general, so instead of using FindModule, 21 # I'll iterate through the module and do a basename match. 22 found_it = False 23 for module in target.modules: 24 file_name = module.GetFileSpec().GetFilename() 25 if file_name.find("unlikely_name") != -1: 26 found_it = True 27 break 28 29 self.assertTrue(found_it, "Couldn't find unlikely_to_occur_name in loaded libraries.") 30 31 32