Пример #1
0
    def test_upgrade_from_v4(self):
        env = Environment.load(os.path.join(test_data_dir, 'environment',
                                            'v4'))

        self.assertEqual(env.bfgdir, Path('/path/to'))
        self.assertEqual(env.backend, 'make')

        self.assertEqual(env.srcdir, Path('/root/srcdir'))
        self.assertEqual(env.builddir, Path('/root/builddir'))
        self.assertDictsEqual(
            env.install_dirs, {
                InstallRoot.prefix: Path('/root/prefix'),
                InstallRoot.exec_prefix: Path('', InstallRoot.prefix),
                InstallRoot.bindir: Path('bin', InstallRoot.exec_prefix),
                InstallRoot.libdir: Path('lib', InstallRoot.exec_prefix),
                InstallRoot.includedir: Path('include', InstallRoot.prefix),
            })

        self.assertEqual(env.library_mode, LibraryMode(True, False))
        self.assertEqual(env.extra_args, [])

        variables = {u'HOME': u'/home/user'}
        self.assertEqual(env.variables, variables)

        self.assertEqual(env.host_platform.name, 'linux')
        self.assertEqual(env.target_platform.name, 'linux')
Пример #2
0
    def test_upgrade_from_v4(self):
        env = Environment.load(os.path.join(test_data_dir, 'environment',
                                            'v4'))

        self.assertEqual(env.bfgdir, Path('/path/to', Root.absolute))
        self.assertEqual(env.backend, 'make')

        self.assertEqual(env.srcdir, Path('/root/srcdir', Root.absolute))
        self.assertEqual(env.builddir, Path('/root/builddir', Root.absolute))
        self.assertDictsEqual(
            env.install_dirs, {
                InstallRoot.prefix: Path('/root/prefix', Root.absolute),
                InstallRoot.exec_prefix: Path('', InstallRoot.prefix),
                InstallRoot.bindir: Path('bin', InstallRoot.exec_prefix),
                InstallRoot.libdir: Path('lib', InstallRoot.exec_prefix),
                InstallRoot.includedir: Path('include', InstallRoot.prefix),
            })

        self.assertEqual(env.library_mode, LibraryMode(True, False))
        self.assertEqual(env.extra_args, [])

        variables = {u'HOME': u'/home/user'}
        if platform_info().family == 'windows' and sys.version_info[0] == 2:
            variables = {str(k): str(v) for k, v in iteritems(variables)}
        self.assertEqual(env.variables, variables)

        self.assertEqual(env.host_platform.name, 'linux')
        self.assertEqual(env.target_platform.name, 'linux')