Lines Matching refs:self

14     def _create_normal_graph(self):  argument
44 def _get_paths_from_nodes(self, nodes): argument
48 def test_get_lib(self): argument
49 gb = self._create_normal_graph()
53 self.assertEqual(gb.libc_32, node)
54 self.assertEqual('/system/lib/libc.so', node.path)
57 self.assertEqual(gb.libdl_64, node)
58 self.assertEqual('/system/lib64/libdl.so', node.path)
61 self.assertEqual(gb.libEGL_64, node)
62 self.assertEqual('/vendor/lib64/libEGL.so', node.path)
64 self.assertEqual(None, graph.get_lib('/no/such/path.so'))
67 def test_map_paths_to_libs(self): argument
68 gb = self._create_normal_graph()
75 self.assertEqual([], bad)
76 self.assertEqual(2, len(nodes))
77 self.assertEqual(paths, self._get_paths_from_nodes(nodes))
82 self.assertEqual(['/no/such/path.so'], bad)
83 self.assertEqual(['/system/lib64/libdl.so'],
84 self._get_paths_from_nodes(nodes))
87 def test_elf_class_and_partitions(self): argument
88 gb = self._create_normal_graph()
90 self.assertEqual(5, len(graph.lib_pt[PT_SYSTEM].lib32))
91 self.assertEqual(5, len(graph.lib_pt[PT_SYSTEM].lib64))
92 self.assertEqual(1, len(graph.lib_pt[PT_VENDOR].lib32))
93 self.assertEqual(1, len(graph.lib_pt[PT_VENDOR].lib64))
96 def test_deps(self): argument
97 gb = self._create_normal_graph()
101 self.assertEqual(['/system/lib/libdl.so', '/system/lib/libm.so'],
102 self._get_paths_from_nodes(node.deps_all))
106 self.assertEqual(['/system/lib64/libdl.so'],
107 self._get_paths_from_nodes(node.deps_all))
111 self.assertEqual(['/system/lib64/libc.so', '/system/lib64/libcutils.so',
113 self._get_paths_from_nodes(node.deps_all))
116 def test_linked_symbols(self): argument
117 gb = self._create_normal_graph()
123 self.assertEqual(set(), lib.unresolved_symbols)
136 self.assertIs(libdl, libc.linked_symbols['dlclose'])
137 self.assertIs(libdl, libc.linked_symbols['dlopen'])
138 self.assertIs(libm, libc.linked_symbols['cos'])
139 self.assertIs(libm, libc.linked_symbols['sin'])
142 self.assertIs(libdl, libRS.linked_symbols['dlclose'])
143 self.assertIs(libdl, libRS.linked_symbols['dlopen'])
144 self.assertIs(libdl, libRS.linked_symbols['dlsym'])
147 self.assertIs(libdl, libcutils.linked_symbols['dlclose'])
148 self.assertIs(libdl, libcutils.linked_symbols['dlopen'])
149 self.assertIs(libc, libcutils.linked_symbols['fclose'])
150 self.assertIs(libc, libcutils.linked_symbols['fopen'])
153 self.assertIs(libc, libEGL.linked_symbols['fclose'])
154 self.assertIs(libc, libEGL.linked_symbols['fopen'])
157 def test_unresolved_symbols(self): argument
165 self.assertEqual({'__does_not_exist'}, lib.unresolved_symbols)
168 def test_users(self): argument
169 gb = self._create_normal_graph()
174 self.assertEqual(['/system/lib/libcutils.so', '/vendor/lib/libEGL.so'],
175 self._get_paths_from_nodes(node.users_all))
179 self.assertEqual(['/system/lib/libRS.so', '/system/lib/libc.so',
181 self._get_paths_from_nodes(node.users_all))
185 self.assertEqual([], self._get_paths_from_nodes(node.users_all))
189 self.assertEqual([], self._get_paths_from_nodes(node.users_all))
192 def test_compute_predefined_sp_hal(self): argument
233 self.assertIn('/system/' + lib + '/hw/gralloc.default.so', sp_hals)
234 self.assertIn('/system/' + lib + '/hw/gralloc.chipset.so', sp_hals)
235 self.assertIn('/system/' + lib + '/hw/'
241 self.assertNotIn('/system/' + lib + '/libvulkan.so', sp_hals)
242 self.assertNotIn('/system/' + lib + '/libEGL.so', sp_hals)
243 self.assertNotIn('/system/' + lib + '/libGLESv1_CM.so', sp_hals)
244 self.assertNotIn('/system/' + lib + '/libGLESv2.so', sp_hals)
245 self.assertNotIn('/system/' + lib + '/libGLESv3.so', sp_hals)
248 self.assertIn('/vendor/' + lib + '/egl/libEGL_chipset.so', sp_hals)
249 self.assertIn('/vendor/' + lib + '/egl/libGLES_chipset.so',
251 self.assertIn('/vendor/' + lib + '/egl/libGLESv1_CM_chipset.so',
253 self.assertIn('/vendor/' + lib + '/egl/libGLESv2_chipset.so',
255 self.assertIn('/vendor/' + lib + '/egl/libGLESv3_chipset.so',
259 self.assertIn('/vendor/' + lib + '/libRSDriver_chipset.so', sp_hals)
260 self.assertIn('/vendor/' + lib + '/libPVRRS.so', sp_hals)
263 self.assertIn('/vendor/' + lib + '/libPVRRS.so', sp_hals)
266 self.assertNotIn('/system/' + lib + '/libfoo.so', sp_hals)
267 self.assertNotIn('/vendor/' + lib + '/libfoo.so', sp_hals)
270 def test_compute_sp_lib(self): argument
319 def classify_lib(self, lib): argument
326 self.assertEqual(2 * 1, len(sp_lib.sp_hal))
327 self.assertEqual(2 * 2, len(sp_lib.sp_hal_dep))
328 self.assertEqual(2 * 2, len(sp_lib.vndk_sp_hal))
329 self.assertEqual(2 * 2, len(sp_lib.ll_ndk))
330 self.assertEqual(2 * 3, len(sp_lib.ll_ndk_indirect))
331 self.assertEqual(2 * 1, len(sp_lib.vndk_sp_both))
333 sp_hal = self._get_paths_from_nodes(sp_lib.sp_hal)
334 sp_hal_dep = self._get_paths_from_nodes(sp_lib.sp_hal_dep)
335 vndk_sp_hal = self._get_paths_from_nodes(sp_lib.vndk_sp_hal)
337 ll_ndk = self._get_paths_from_nodes(sp_lib.ll_ndk)
338 ll_ndk_indirect = self._get_paths_from_nodes(sp_lib.ll_ndk_indirect)
340 vndk_sp_both = self._get_paths_from_nodes(sp_lib.vndk_sp_both)
344 self.assertIn('/system/{}/libsp_both_vs.so'.format(lib_dir),
348 self.assertIn('/system/{}/libcutils.so'.format(lib_dir),
350 self.assertIn('/system/{}/libcutils_dep.so'.format(lib_dir),
352 self.assertIn('/system/{}/libutils.so'.format(lib_dir),
356 self.assertIn('/system/{}/libhidlbase.so'.format(lib_dir),
358 self.assertIn('/system/{}/libhidlmemory.so'.format(lib_dir),
362 self.assertIn('/vendor/{}/libllvm_vendor.so'.format(lib_dir),
364 self.assertIn('/vendor/{}/libllvm_vendor_dep.so'.format(lib_dir),
368 self.assertIn('/vendor/{}/egl/libEGL_chipset.so'.format(lib_dir),
372 self.assertIn('/system/{}/libEGL.so'.format(lib_dir), ll_ndk)
373 self.assertIn('/system/{}/libc.so'.format(lib_dir), ll_ndk)
377 self.assertNotIn(libc_path, sp_hal)
378 self.assertNotIn(libc_path, sp_hal_dep)
379 self.assertNotIn(libc_path, vndk_sp_hal)
380 self.assertNotIn(libc_path, ll_ndk_indirect)
383 def test_link_vndk_ver_dirs(self): argument
423 self.assertIn(libc_32, libvndk_a_32.deps_all)
424 self.assertIn(libc_32, libvndk_b_32.deps_all)
425 self.assertIn(libc_32, libvndk_c_32.deps_all)
426 self.assertIn(libc_32, libvndk_d_32.deps_all)
427 self.assertIn(libc_32, libvndk_sp_a_32.deps_all)
428 self.assertIn(libc_32, libvndk_sp_b_32.deps_all)
429 self.assertIn(libc_32, libvndk_sp_c_32.deps_all)
430 self.assertIn(libc_32, libvndk_sp_d_32.deps_all)
432 self.assertIn(libvndk_b_32, libvndk_a_32.deps_all)
433 self.assertIn(libvndk_sp_b_32, libvndk_a_32.deps_all)
434 self.assertIn(libvndk_sp_b_32, libvndk_b_32.deps_all)
435 self.assertIn(libvndk_sp_b_32, libvndk_sp_a_32.deps_all)
437 self.assertIn(libvndk_d_32, libvndk_c_32.deps_all)
438 self.assertIn(libvndk_sp_d_32, libvndk_c_32.deps_all)
439 self.assertIn(libvndk_sp_d_32, libvndk_d_32.deps_all)
440 self.assertIn(libvndk_sp_d_32, libvndk_sp_c_32.deps_all)
443 self.assertIn(libc_64, libvndk_a_64.deps_all)
444 self.assertIn(libc_64, libvndk_b_64.deps_all)
445 self.assertIn(libc_64, libvndk_c_64.deps_all)
446 self.assertIn(libc_64, libvndk_d_64.deps_all)
447 self.assertIn(libc_64, libvndk_sp_a_64.deps_all)
448 self.assertIn(libc_64, libvndk_sp_b_64.deps_all)
449 self.assertIn(libc_64, libvndk_sp_c_64.deps_all)
450 self.assertIn(libc_64, libvndk_sp_d_64.deps_all)
452 self.assertIn(libvndk_b_64, libvndk_a_64.deps_all)
453 self.assertIn(libvndk_sp_b_64, libvndk_a_64.deps_all)
454 self.assertIn(libvndk_sp_b_64, libvndk_b_64.deps_all)
455 self.assertIn(libvndk_sp_b_64, libvndk_sp_a_64.deps_all)
457 self.assertIn(libvndk_d_64, libvndk_c_64.deps_all)
458 self.assertIn(libvndk_sp_d_64, libvndk_c_64.deps_all)
459 self.assertIn(libvndk_sp_d_64, libvndk_d_64.deps_all)
460 self.assertIn(libvndk_sp_d_64, libvndk_sp_c_64.deps_all)
463 def test_rewrite_apex_modules(self): argument
473 self.assertEqual(libfoo.path, '/apex/foo/lib/libfoo.so')
474 self.assertEqual(libbar.path, '/apex/bar/lib/libbar.so')
477 def test_link_apex_modules(self): argument
489 self.assertIn(libfoo, libbar.deps_all)
492 def test_link_apex_bionic(self): argument
505 self.assertIn(libc, libbar.deps_all)
509 def test_add_dlopen_deps(self): argument
520 self.assertIn(libb, liba.deps_dlopen)
521 self.assertIn(liba, libb.users_dlopen)
523 self.assertNotIn(libb, liba.deps_needed)
524 self.assertNotIn(liba, libb.users_needed)
527 def test_add_dlopen_deps_lib_subst(self): argument
538 self.assertIn(libb_32, liba_32.deps_dlopen)
539 self.assertIn(liba_32, libb_32.users_dlopen)
541 self.assertIn(libb_64, liba_64.deps_dlopen)
542 self.assertIn(liba_64, libb_64.users_dlopen)
545 def test_add_dlopen_deps_lib_subset_single_bitness(self): argument
559 self.assertEqual('', stderr.getvalue())
561 self.assertIn(liba_32, libb_32.deps_dlopen)
562 self.assertIn(libb_32, liba_32.users_dlopen)
564 self.assertEqual(0, len(liba_64.users_dlopen))
567 def test_add_dlopen_deps_regex(self): argument
581 self.assertEqual('', stderr.getvalue())
583 self.assertIn(liba, libb.deps_dlopen)
584 self.assertIn(libb, liba.users_dlopen)
587 def test_add_dlopen_deps_error(self): argument
601 self.assertRegex(