Пример #1
0
 def test_contents_fat(self):
     expected_contents = [
         'fat_64_cherry.o',
         'fat_64_kiwi.o',
     ]
     actual_contents = ar_replacement.contents(
         self._test_file('fat_64_fruits.a'))
     actual_contents = self._filter_contents(actual_contents)
     self.assertEqual(expected_contents, actual_contents)
Пример #2
0
 def test_contents_thin(self):
     expected_contents = [
         'thin_cherry.o',
         'thin_kiwi.o',
     ]
     actual_contents = ar_replacement.contents(
         self._test_file('thin_fruits_x86_64.a'))
     actual_contents = self._filter_contents(actual_contents)
     self.assertEqual(expected_contents, actual_contents)
Пример #3
0
 def test_replace_fat(self):
     expected_objects = [
         'fat_cherry.o',
         'fat_kiwi.o',
     ]
     tmp_dir = temp_file.make_temp_dir()
     tmp_archive = path.join(tmp_dir, 'fat_fruits.a')
     objects = [self._test_file(o) for o in expected_objects]
     ar_replacement.replace(tmp_archive, objects)
     actual_objects = ar_replacement.contents(tmp_archive)
     actual_objects = self._filter_contents(actual_objects)
     self.assertEqual(expected_objects, actual_objects)
Пример #4
0
 def test_replace_add_thin(self):
     expected_objects = [
         'thin_cherry.o',
         'thin_kiwi.o',
     ]
     tmp_dir = temp_file.make_temp_dir()
     tmp_archive = path.join(tmp_dir, 'thin_fruits.a')
     objects = [self._test_file(o) for o in expected_objects]
     ar_replacement.replace(tmp_archive, objects)
     actual_objects = ar_replacement.contents(tmp_archive)
     actual_objects = self._filter_contents(actual_objects)
     self.assertEqual(expected_objects, actual_objects)
     expected_objects = [
         'thin_cherry.o',
         'thin_kiwi.o',
         'thin_x86_64_avocado.o',
     ]
     objects = [self._test_file(o) for o in ['thin_x86_64_avocado.o']]
     ar_replacement.replace(tmp_archive, objects)
     actual_objects = ar_replacement.contents(tmp_archive)
     actual_objects = self._filter_contents(actual_objects)
     self.assertEqual(expected_objects, actual_objects)
Пример #5
0
 def _command_contents(self, archive, tools):
     contents = ar_replacement.contents(archive, tools=tools)
     for c in contents:
         print(c)