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


Python Manager.set_up_run方法代码示例

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


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

示例1: run

# 需要导入模块: from webkitpy.layout_tests.controllers.manager import Manager [as 别名]
# 或者: from webkitpy.layout_tests.controllers.manager.Manager import set_up_run [as 别名]
def run(port, options, args, regular_output=sys.stderr, buildbot_output=sys.stdout):
    """Run the tests.

    Args:
      port: Port object for port-specific behavior
      options: a dictionary of command line options
      args: a list of sub directories or files to test
      regular_output: a stream-like object that we can send logging/debug
          output to
      buildbot_output: a stream-like object that we can write all output that
          is intended to be parsed by the buildbot to
    Returns:
      the number of unexpected results that occurred, or -1 if there is an
          error.

    """
    warnings = _set_up_derived_options(port, options)

    printer = printing.Printer(port, options, regular_output, buildbot_output, configure_logging=True)
    for w in warnings:
        _log.warning(w)

    if options.help_printing:
        printer.help_printing()
        printer.cleanup()
        return 0

    # We wrap any parts of the run that are slow or likely to raise exceptions
    # in a try/finally to ensure that we clean up the logging configuration.
    num_unexpected_results = -1
    try:
        manager = Manager(port, options, printer)
        manager.print_config()

        printer.print_update("Collecting tests ...")
        try:
            manager.collect_tests(args)
        except IOError, e:
            if e.errno == errno.ENOENT:
                return -1
            raise

        if options.lint_test_files:
            return manager.lint()

        printer.print_update("Checking build ...")
        if not port.check_build(manager.needs_servers()):
            _log.error("Build check failed")
            return -1

        printer.print_update("Parsing expectations ...")
        manager.parse_expectations()

        result_summary = manager.set_up_run()
        if result_summary:
            num_unexpected_results = manager.run(result_summary)
            manager.clean_up_run()
            _log.debug("Testing completed, Exit status: %d" % num_unexpected_results)
开发者ID:sysrqb,项目名称:chromium-src,代码行数:60,代码来源:run_webkit_tests.py

示例2: run

# 需要导入模块: from webkitpy.layout_tests.controllers.manager import Manager [as 别名]
# 或者: from webkitpy.layout_tests.controllers.manager.Manager import set_up_run [as 别名]
def run(port, options, args, regular_output=sys.stderr, buildbot_output=sys.stdout):
    warnings = _set_up_derived_options(port, options)

    printer = printing.Printer(port, options, regular_output, buildbot_output, configure_logging=True)

    for warning in warnings:
        _log.warning(warning)

    if options.help_printing:
        printer.help_printing()
        printer.cleanup()
        return 0

    if options.lint_test_files:
        return lint(port, options, test_expectations.TestExpectations)

    # We wrap any parts of the run that are slow or likely to raise exceptions
    # in a try/finally to ensure that we clean up the logging configuration.
    unexpected_result_count = -1
    try:
        manager = Manager(port, options, printer)
        manager.print_config()

        printer.print_update("Collecting tests ...")
        try:
            manager.collect_tests(args)
        except IOError, e:
            if e.errno == errno.ENOENT:
                return -1
            raise

        printer.print_update("Checking build ...")
        if not port.check_build(manager.needs_servers()):
            _log.error("Build check failed")
            return -1

        printer.print_update("Parsing expectations ...")
        manager.parse_expectations()

        result_summary = manager.set_up_run()
        if result_summary:
            unexpected_result_count = manager.run(result_summary)
            manager.clean_up_run()
            _log.debug("Testing completed, Exit status: %d" % unexpected_result_count)
开发者ID:sohocoke,项目名称:webkit,代码行数:46,代码来源:run_webkit_tests.py


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