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


Python ProcessHandler.waitForFinish方法代码示例

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


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

示例1: test_relative_path

# 需要导入模块: from mozprocess import ProcessHandler [as 别名]
# 或者: from mozprocess.ProcessHandler import waitForFinish [as 别名]
    def test_relative_path(self):
        tempdir = tempfile.mkdtemp()

        # make a dummy profile
        profile = FirefoxProfile(os.path.join(tempdir, 'testprofilepath'),
                                 restore=False)
        self.assertTrue(os.path.exists(os.path.join(tempdir,
                                                    'testprofilepath',
                                                    'user.js')))

        # make a dummy test
        test = """var test = function () { };"""
        f = file(os.path.join(tempdir, 'test_dummy.js'), 'w')
        f.write(test)
        f.close()

        # run mozmill on it
        process = ProcessHandler(['mozmill',
                                  '-t', 'test_dummy.js',
                                  '--profile=testprofilepath'],
                                 cwd=tempdir)
        process.run()
        process.waitForFinish()

        self.assertNotEqual(process.proc.poll(), None)

        # cleanup
        shutil.rmtree(tempdir)
开发者ID:Ghost-script,项目名称:mozmill,代码行数:30,代码来源:testprofilepath.py

示例2: run_tests

# 需要导入模块: from mozprocess import ProcessHandler [as 别名]
# 或者: from mozprocess.ProcessHandler import waitForFinish [as 别名]
    def run_tests(self):
        """
        Run the tests using runtests.py
        """
        # Unfortunately, we can't use --close-when-done on single tests, so just run all of 
        # Harness_sanity and parse out the relevant data.Can change this when Bug 508664 
        # is resolved, as it will allow us to close single tests.
        runtests_location = os.path.join(self.test_path, 'mochitest', 'runtests.py')
        profile_location = os.path.join(self.test_path, 'mochitest', 'profile_path')
        try:
            shutil.rmtree(temp_dir_path)
        except:
            pass
        extra_args = '--repeat=%s'

        harness = 'Harness_sanity'
        extra_profile_file = os.path.join(self.util_path, 'plugins')
        def timeout_log():
            print "Timed out"
        proc = ProcessHandler(['python',
                                runtests_location,
                                '--profile-path=%s' % profile_location, 
                                '--test-path=%s' % harness,
                                extra_args % PLAIN_REPEATS,
                                '--certificate-path=%s' % self.cert_path,
                                '--utility-path=%s' % self.util_path,
                                '--appname=%s' % self.app_name,
                                '--log-file=%s' % self.plain_log_file,
                                '--extra-profile-file=%s' % extra_profile_file,
                                '--close-when-done',
                                '--autorun'
                                ])
        proc.onTimeout = timeout_log
        proc.waitForFinish(timeout=3600, logfile=os.path.join(self.log_dir, "profiler_log_%s" % self.builddata['timestamp']))
        for test_path in CHROME_TESTS:
            proc = ProcessHandler(['python',
                                    runtests_location,
                                    '--profile-path=%s' % profile_location,
                                    '--chrome',
                                    '--test-path=%s' % test_path,
                                    extra_args % CHROME_REPEATS,
                                    '--certificate-path=%s' % self.cert_path,
                                    '--utility-path=%s' % self.util_path,
                                    '--appname=%s' % self.app_name,
                                    '--log-file=%s' % self.chrome_log_file,
                                    '--close-when-done',
                                    '--autorun'
                                    ])
        proc.onTimeout = timeout_log
        proc.waitForFinish(timeout=3600, logfile=os.path.join(self.log_dir, "profiler_log_%s" % self.builddata['timestamp']))
        self.log.info("Done running tests")
开发者ID:malini,项目名称:mochi-profiler,代码行数:53,代码来源:profiler.py

示例3: test_options

# 需要导入模块: from mozprocess import ProcessHandler [as 别名]
# 或者: from mozprocess.ProcessHandler import waitForFinish [as 别名]
    def test_options(self):
        absdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
        testdir = os.path.join(absdir, 'js-tests')

        process = ProcessHandler(['mozmill',
                                  '-b', os.environ['BROWSER_PATH'],
                                  '-t', os.path.join(testdir,
                                                     'test_module1.js'),
                                  '-m', os.path.join(testdir, 'example.ini')
                                 ])
        process.run()
        process.waitForFinish()

        self.assertNotEqual(process.proc.poll(), 0,
                            'Parser error due to -t and -m are mutually exclusive')
开发者ID:ahal,项目名称:mozmill,代码行数:17,代码来源:options_tests_and_manifest.py

示例4: execute_cmd

# 需要导入模块: from mozprocess import ProcessHandler [as 别名]
# 或者: from mozprocess.ProcessHandler import waitForFinish [as 别名]
def execute_cmd(cmd, cwd):
    print 'executing', cmd
    proc = ProcessHandler(cmd, cwd=cwd)
    proc.processOutput(timeout=180)
    assert(proc.waitForFinish() == 0)
开发者ID:jonallengriffin,项目名称:b2gautomation,代码行数:7,代码来源:make_device_manifests.py


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