From aa4c811c0c1444c5073bdd37601144d74f5d979e Mon Sep 17 00:00:00 2001 From: Andoni Morales Alastruey Date: Wed, 25 Jul 2012 14:43:17 +0200 Subject: osxuniversalgenerator: relocate properly universal objects --- test/test_cerbero_tools_osxuniversalgenerator.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test') diff --git a/test/test_cerbero_tools_osxuniversalgenerator.py b/test/test_cerbero_tools_osxuniversalgenerator.py index b33ba977..4fc74637 100644 --- a/test/test_cerbero_tools_osxuniversalgenerator.py +++ b/test/test_cerbero_tools_osxuniversalgenerator.py @@ -24,6 +24,7 @@ import os from cerbero.config import Architecture from cerbero.utils import shell from cerbero.tools.osxuniversalgenerator import OSXUniversalGenerator +from cerbero.tools.osxrelocator import OSXRelocator TEST_APP = '''\ @@ -172,3 +173,25 @@ class OSXUniversalGeneratorTest(unittest.TestCase): pc_file = os.path.join(self.tmp, Architecture.UNIVERSAL, 'test.pc') self.assertEquals(open(pc_file).readline(), os.path.join(self.tmp, Architecture.UNIVERSAL, 'lib', 'test')) + + def testMergedLibraryPaths(self): + def check_prefix(path): + if self.tmp not in path: + return + self.assertTrue(uni_prefix in path) + self.assertTrue(x86_prefix not in path) + self.assertTrue(x86_64_prefix not in path) + + self._compile(Architecture.X86) + self._compile(Architecture.X86_64) + self._check_compiled_files() + uni_prefix = os.path.join(self.tmp, Architecture.UNIVERSAL) + x86_prefix = os.path.join(self.tmp, Architecture.X86) + x86_64_prefix = os.path.join(self.tmp, Architecture.X86_64) + gen = OSXUniversalGenerator(uni_prefix) + gen.merge_dirs([x86_prefix, x86_64_prefix]) + libfoo = os.path.join(self.tmp, Architecture.UNIVERSAL, 'lib', 'libfoo.so') + libname = OSXRelocator.library_id_name(libfoo) + check_prefix(libname) + for p in OSXRelocator.list_shared_libraries(libfoo): + check_prefix(p) -- cgit v1.2.3