本文整理汇总了Python中webkitpy.layout_tests.controllers.manager.Manager.lint方法的典型用法代码示例。如果您正苦于以下问题:Python Manager.lint方法的具体用法?Python Manager.lint怎么用?Python Manager.lint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webkitpy.layout_tests.controllers.manager.Manager
的用法示例。
在下文中一共展示了Manager.lint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from webkitpy.layout_tests.controllers.manager import Manager [as 别名]
# 或者: from webkitpy.layout_tests.controllers.manager.Manager import lint [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)
示例2: run
# 需要导入模块: from webkitpy.layout_tests.controllers.manager import Manager [as 别名]
# 或者: from webkitpy.layout_tests.controllers.manager.Manager import lint [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
# 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
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:
unexpected_result_count = manager.run(result_summary)
manager.clean_up_run()
_log.debug("Testing completed, Exit status: %d" % unexpected_result_count)