def add_package_dep(dep_dict, dep): dep_dict['origin'] = dep if os.path.isdir(dep): pkg = package.Package(info_file=os.path.join(dep, 'pkg_info')) dep_dict['version'] = pkg.VERSION return for subdir in DEFAULT_LOCATIONS: pkg_info_file = os.path.join(paths.NACLPORTS_ROOT, subdir, dep, 'pkg_info') if os.path.exists(pkg_info_file): dep_dict['version'] = package.Package(info_file=pkg_info_file).VERSION return raise Error("Package not found: %s" % dep)
def test_invalid_arch_disabled(self): pkg = package.Package() with self.assertRaisesRegexp(error.Error, 'invalid architecture: foo'): pkg.parse_info(test_info + 'DISABLED_ARCH=(foo)')
def test_valid_arch_disabled(self): # pylint: disable=no-self-use pkg = package.Package() pkg.parse_info(test_info + 'DISABLED_ARCH=(arm i686 x86_64)')
def test_invalid_toolchain_disabled(self): pkg = package.Package() with self.assertRaisesRegexp(error.Error, 'invalid toolchain: foo'): pkg.parse_info(test_info + 'DISABLED_TOOLCHAIN=(foo)')
def test_valid_toolchain_disabled(self): # pylint: disable=no-self-use pkg = package.Package() pkg.parse_info(test_info + 'DISABLED_TOOLCHAIN=(pnacl glibc clang-newlib)')
def test_invalid_libc_disabled(self): pkg = package.Package() # clang-newlib is a toolchain, not a libc with self.assertRaisesRegexp(error.Error, 'invalid libc: clang-newlib'): pkg.parse_info(test_info + 'DISABLED_LIBC=(clang-newlib)')
def test_valid_libc_disabled(self): # pylint: disable=no-self-use pkg = package.Package() pkg.parse_info(test_info + 'DISABLED_LIBC=(newlib glibc)')
def testValidArchDisabled(self): # pylint: disable=no-self-use pkg = package.Package() pkg.ParseInfo(test_info + 'DISABLED_ARCH=(arm i686 x86_64)')
def testValidLibcDisabled(self): # pylint: disable=no-self-use pkg = package.Package() pkg.ParseInfo(test_info + 'DISABLED_LIBC=(newlib glibc)')