コード例 #1
0
ファイル: test_dyld.py プロジェクト: BMXE/music-player
    def test_inject_suffixes(self):
        if 'DYLD_IMAGE_SUFFIX' in os.environ:
            del os.environ['DYLD_IMAGE_SUFFIX']


        # No suffix
        paths = [ '/usr/lib/libSystem.dylib',
                '/lib/libfoo.3.dylib',
                '/System/Library/Frameworks/CorePython.framework/Versions/B/CorePython',
                '/System/Library/Frameworks/CorePython.framework/CorePython',
        ]
        self.assertEqual(list(dyld.inject_suffixes(iter(paths))), paths)
        self.assertIs(dyld.inject_suffixes(paths), paths)

        os.environ['DYLD_IMAGE_SUFFIX'] = '_DEBUG'
        self.maxDiff = None
        self.assertEqual(list(dyld.inject_suffixes(iter(paths))), [
                '/usr/lib/libSystem_DEBUG.dylib',
                '/usr/lib/libSystem.dylib',
                '/lib/libfoo.3_DEBUG.dylib',
                '/lib/libfoo.3.dylib',
                '/System/Library/Frameworks/CorePython.framework/Versions/B/CorePython_DEBUG',
                '/System/Library/Frameworks/CorePython.framework/Versions/B/CorePython',
                '/System/Library/Frameworks/CorePython.framework/CorePython_DEBUG',
                '/System/Library/Frameworks/CorePython.framework/CorePython',
        ])
コード例 #2
0
    def test_inject_suffixes(self):
        if "DYLD_IMAGE_SUFFIX" in os.environ:
            del os.environ["DYLD_IMAGE_SUFFIX"]

        # No suffix
        paths = [
            "/usr/lib/libSystem.dylib",
            "/lib/libfoo.3.dylib",
            "/System/Library/Frameworks/CorePython.framework/Versions/B/CorePython",
            "/System/Library/Frameworks/CorePython.framework/CorePython",
        ]
        self.assertEqual(list(dyld.inject_suffixes(iter(paths))), paths)
        self.assertIs(dyld.inject_suffixes(paths), paths)

        os.environ["DYLD_IMAGE_SUFFIX"] = "_DEBUG"
        self.maxDiff = None
        self.assertEqual(
            list(dyld.inject_suffixes(iter(paths))),
            [
                "/usr/lib/libSystem_DEBUG.dylib",
                "/usr/lib/libSystem.dylib",
                "/lib/libfoo.3_DEBUG.dylib",
                "/lib/libfoo.3.dylib",
                "/System/Library/Frameworks/CorePython.framework/Versions/B/CorePython_DEBUG",
                "/System/Library/Frameworks/CorePython.framework/Versions/B/CorePython",
                "/System/Library/Frameworks/CorePython.framework/CorePython_DEBUG",
                "/System/Library/Frameworks/CorePython.framework/CorePython",
            ],
        )
コード例 #3
0
ファイル: test_dyld.py プロジェクト: P79N6A/apple-opensource
    def test_inject_suffixes(self):
        if 'DYLD_IMAGE_SUFFIX' in os.environ:
            del os.environ['DYLD_IMAGE_SUFFIX']

        # No suffix
        paths = [
            '/usr/lib/libSystem.dylib',
            '/lib/libfoo.3.dylib',
            '/System/Library/Frameworks/CorePython.framework/Versions/B/CorePython',
            '/System/Library/Frameworks/CorePython.framework/CorePython',
        ]
        self.assertEqual(list(dyld.inject_suffixes(iter(paths))), paths)
        self.assertIs(dyld.inject_suffixes(paths), paths)

        os.environ['DYLD_IMAGE_SUFFIX'] = '_DEBUG'
        self.maxDiff = None
        self.assertEqual(list(dyld.inject_suffixes(iter(paths))), [
            '/usr/lib/libSystem_DEBUG.dylib',
            '/usr/lib/libSystem.dylib',
            '/lib/libfoo.3_DEBUG.dylib',
            '/lib/libfoo.3.dylib',
            '/System/Library/Frameworks/CorePython.framework/Versions/B/CorePython_DEBUG',
            '/System/Library/Frameworks/CorePython.framework/Versions/B/CorePython',
            '/System/Library/Frameworks/CorePython.framework/CorePython_DEBUG',
            '/System/Library/Frameworks/CorePython.framework/CorePython',
        ])