]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/TestPreRunDylibs.py
Vendor import of lldb trunk r351319 (just before the release_80 branch
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / functionalities / pre_run_dylibs / TestPreRunDylibs.py
1 from __future__ import print_function
2
3 import unittest2
4 import lldb
5 from lldbsuite.test.lldbtest import *
6 import lldbsuite.test.lldbutil as lldbutil
7 from lldbsuite.test.decorators import *
8
9 class TestPreRunLibraries(TestBase):
10
11     mydir = TestBase.compute_mydir(__file__)
12     NO_DEBUG_INFO_TESTCASE = True
13
14     def setUp(self):
15         # Call super's setUp().
16         TestBase.setUp(self)
17
18     @skipIf(oslist=no_match(['darwin','macos']))
19     def test(self):
20         """Test that we find directly linked dylib pre-run."""
21
22         self.build()
23         target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
24         self.assertTrue(target, VALID_TARGET)
25
26         # I don't know what the name of a shared library
27         # extension is in general, so instead of using FindModule,
28         # I'll iterate through the module and do a basename match.
29         found_it = False
30         for module in target.modules:
31             file_name = module.GetFileSpec().GetFilename()
32             if file_name.find("unlikely_name") != -1:
33                 found_it = True
34                 break
35
36         self.assertTrue(found_it, "Couldn't find unlikely_to_occur_name in loaded libraries.")
37
38