本文整理汇总了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)
示例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)
示例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)
示例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))