当前位置: 首页>>代码示例>>Python>>正文


Python MozbuildObject._spawn方法代码示例

本文整理汇总了Python中mozbuild.base.MozbuildObject._spawn方法的典型用法代码示例。如果您正苦于以下问题:Python MozbuildObject._spawn方法的具体用法?Python MozbuildObject._spawn怎么用?Python MozbuildObject._spawn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mozbuild.base.MozbuildObject的用法示例。


在下文中一共展示了MozbuildObject._spawn方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _get_resolver

# 需要导入模块: from mozbuild.base import MozbuildObject [as 别名]
# 或者: from mozbuild.base.MozbuildObject import _spawn [as 别名]
    def _get_resolver(self):
        topobjdir = tempfile.mkdtemp()
        self._temp_dirs.append(topobjdir)

        with open(os.path.join(topobjdir, "all-tests.json"), "wt") as fh:
            fh.write(ALL_TESTS_JSON)

        o = MozbuildObject(self.FAKE_TOPSRCDIR, None, None, topobjdir=topobjdir)

        return o._spawn(TestResolver)
开发者ID:jpetrell,项目名称:gecko-dev,代码行数:12,代码来源:test_testing.py

示例2: _get_resolver

# 需要导入模块: from mozbuild.base import MozbuildObject [as 别名]
# 或者: from mozbuild.base.MozbuildObject import _spawn [as 别名]
    def _get_resolver(self):
        topobjdir = tempfile.mkdtemp()
        self._temp_dirs.append(topobjdir)

        with open(os.path.join(topobjdir, 'all-tests.json'), 'wt') as fh:
            fh.write(ALL_TESTS_JSON)

        o = MozbuildObject(self.FAKE_TOPSRCDIR, None, None, topobjdir=topobjdir)

        # Monkey patch the test resolver to avoid tests failing to find make
        # due to our fake topscrdir.
        TestResolver._run_make = lambda *a, **b: None

        return o._spawn(TestResolver)
开发者ID:MekliCZ,项目名称:positron,代码行数:16,代码来源:test_testing.py

示例3: _get_resolver

# 需要导入模块: from mozbuild.base import MozbuildObject [as 别名]
# 或者: from mozbuild.base.MozbuildObject import _spawn [as 别名]
    def _get_resolver(self):
        topobjdir = tempfile.mkdtemp()
        self._temp_dirs.append(topobjdir)

        with open(os.path.join(topobjdir, 'all-tests.pkl'), 'wb') as fh:
            pickle.dump(ALL_TESTS, fh)
        with open(os.path.join(topobjdir, 'test-defaults.pkl'), 'wb') as fh:
            pickle.dump(TEST_DEFAULTS, fh)

        o = MozbuildObject(self.FAKE_TOPSRCDIR, None, None, topobjdir=topobjdir)

        # Monkey patch the test resolver to avoid tests failing to find make
        # due to our fake topscrdir.
        TestResolver._run_make = lambda *a, **b: None

        return o._spawn(TestResolver)
开发者ID:luke-chang,项目名称:gecko-1,代码行数:18,代码来源:test_resolve.py

示例4: test_mozconfig_opt_in

# 需要导入模块: from mozbuild.base import MozbuildObject [as 别名]
# 或者: from mozbuild.base.MozbuildObject import _spawn [as 别名]
    def test_mozconfig_opt_in(self):
        """Auto clobber iff AUTOCLOBBER is in the environment."""

        topsrcdir = self.get_topsrcdir()
        topobjdir = self.get_tempdir()

        obj_clobber = os.path.join(topobjdir, 'CLOBBER')
        with open(obj_clobber, 'a'):
            pass

        dummy_file = os.path.join(topobjdir, 'dummy_file')
        with open(dummy_file, 'a'):
            pass

        self.assertTrue(os.path.exists(dummy_file))

        old_time = os.path.getmtime(os.path.join(topsrcdir, 'CLOBBER')) - 60
        os.utime(obj_clobber, (old_time, old_time))

        # Check auto clobber is off by default
        env = dict(os.environ)
        if env.get('AUTOCLOBBER', False):
            del env['AUTOCLOBBER']

        mbo = MozbuildObject(topsrcdir, None, None, topobjdir)
        build = mbo._spawn(BuildDriver)

        status = build._check_clobber(build.mozconfig, env)

        self.assertEqual(status, True)
        self.assertTrue(os.path.exists(dummy_file))

        # Check auto clobber opt-in works
        env['AUTOCLOBBER'] = '1'

        status = build._check_clobber(build.mozconfig, env)
        self.assertFalse(status)
        self.assertFalse(os.path.exists(dummy_file))
开发者ID:luke-chang,项目名称:gecko-1,代码行数:40,代码来源:test_clobber.py


注:本文中的mozbuild.base.MozbuildObject._spawn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。