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


Python run_webkit_tests.parse_args函数代码示例

本文整理汇总了Python中webkitpy.layout_tests.run_webkit_tests.parse_args函数的典型用法代码示例。如果您正苦于以下问题:Python parse_args函数的具体用法?Python parse_args怎么用?Python parse_args使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: logging_run

def logging_run(extra_args=None, port_obj=None, tests_included=False):
    extra_args = extra_args or []
    args = ['--no-record-results']
    if not '--platform' in extra_args:
        args.extend(['--platform', 'test'])
    if not '--child-processes' in extra_args:
        args.extend(['--worker-model', 'inline'])
    args.extend(extra_args)
    if not tests_included:
        args.extend(['passes',
                     'http/tests',
                     'websocket/tests',
                     'failures/expected/*'])

    oc = outputcapture.OutputCapture()
    try:
        oc.capture_output()
        options, parsed_args = run_webkit_tests.parse_args(args)
        user = MockUser()
        if not port_obj:
            port_obj = port.get(port_name=options.platform, options=options,
                                user=user)
        buildbot_output = array_stream.ArrayStream()
        regular_output = array_stream.ArrayStream()
        res = run_webkit_tests.run(port_obj, options, parsed_args,
                                   buildbot_output=buildbot_output,
                                   regular_output=regular_output)
    finally:
        oc.restore_output()
    return (res, buildbot_output, regular_output, user)
开发者ID:Andersbakken,项目名称:check-coding-style,代码行数:30,代码来源:run_webkit_tests_unittest.py

示例2: get_port_for_run

 def get_port_for_run(args):
     options, parsed_args = run_webkit_tests.parse_args(args)
     host = MockHost()
     test_port = ImageDiffTestPort(host, options=options)
     res = passing_run(args, port_obj=test_port, tests_included=True)
     self.assertTrue(res)
     return test_port
开发者ID:Anthony-Biget,项目名称:openjfx,代码行数:7,代码来源:run_webkit_tests_integrationtest.py

示例3: _runner

    def _runner(self, port=None):
        # FIXME: we shouldn't have to use run_webkit_tests.py to get the options we need.
        options = run_webkit_tests.parse_args(['--platform', 'test-mac-snowleopard'])[0]
        options.child_processes = '1'

        host = MockHost()
        port = port or host.port_factory.get(options.platform, options=options)
        return LockCheckingRunner(port, options, FakePrinter(), self, True)
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:8,代码来源:layout_test_runner_unittest.py

示例4: _runner

    def _runner(self, port=None):
        # FIXME: we shouldn't have to use run_webkit_tests.py to get the options we need.
        options = run_webkit_tests.parse_args(['--platform', 'test-mac-snowleopard'])[0]
        options.child_processes = '1'

        host = MockHost()
        port = port or host.port_factory.get(options.platform, options=options)
        return LayoutTestRunner(options, port, FakePrinter(), port.results_directory(), lambda test_name: False)
开发者ID:cheekiatng,项目名称:webkit,代码行数:8,代码来源:layout_test_runner_unittest.py

示例5: passing_run

def passing_run(args, port_obj=None, logging_included=False):
    if not logging_included:
        args.extend(['--print', 'nothing'])
    options, args = run_webkit_tests.parse_args(args)
    if port_obj is None:
        port_obj = port.get(options.platform, options)
    res = run_webkit_tests.run(port_obj, options, args)
    return res == 0
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:8,代码来源:run_webkit_tests_unittest.py

示例6: logging_run

def logging_run(args):
    options, args = run_webkit_tests.parse_args(args)
    port_obj = port.get(options.platform, options)
    buildbot_output = array_stream.ArrayStream()
    regular_output = array_stream.ArrayStream()
    res = run_webkit_tests.run(port_obj, options, args,
                               buildbot_output=buildbot_output,
                               regular_output=regular_output)
    return (res, buildbot_output, regular_output)
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:9,代码来源:run_webkit_tests_unittest.py

示例7: get_tests_run

def get_tests_run(extra_args=None, tests_included=False, flatten_batches=False):
    extra_args = extra_args or []
    args = [
        '--print', 'nothing',
        '--platform', 'test',
        '--no-record-results',
        '--worker-model', 'inline']
    args.extend(extra_args)
    if not tests_included:
        # Not including http tests since they get run out of order (that
        # behavior has its own test, see test_get_test_file_queue)
        args.extend(['passes', 'failures'])
    options, parsed_args = run_webkit_tests.parse_args(args)
    user = MockUser()

    test_batches = []

    class RecordingTestDriver(TestDriver):
        def __init__(self, port, worker_number):
            TestDriver.__init__(self, port, worker_number)
            self._current_test_batch = None

        def poll(self):
            # So that we don't create a new driver for every test
            return None

        def stop(self):
            self._current_test_batch = None

        def run_test(self, test_input):
            if self._current_test_batch is None:
                self._current_test_batch = []
                test_batches.append(self._current_test_batch)
            test_name = self._port.relative_test_filename(test_input.filename)
            self._current_test_batch.append(test_name)
            return TestDriver.run_test(self, test_input)

    class RecordingTestPort(TestPort):
        def create_driver(self, worker_number):
            return RecordingTestDriver(self, worker_number)

    recording_port = RecordingTestPort(options=options, user=user)
    logging_run(extra_args=args, port_obj=recording_port, tests_included=True)

    if flatten_batches:
        return list(itertools.chain(*test_batches))

    return test_batches
开发者ID:Andersbakken,项目名称:check-coding-style,代码行数:48,代码来源:run_webkit_tests_unittest.py

示例8: test_missing_and_unexpected_results_with_custom_exit_code

    def test_missing_and_unexpected_results_with_custom_exit_code(self):
        # Test that we update expectations in place. If the expectation
        # is missing, update the expected generic location.
        class CustomExitCodePort(test.TestPort):
            def exit_code_from_summarized_results(self, unexpected_results):
                return unexpected_results['num_regressions'] + unexpected_results['num_missing']

        host = MockHost()
        options, parsed_args = run_webkit_tests.parse_args(['--pixel-tests', '--no-new-test-results'])
        test_port = CustomExitCodePort(host, options=options)
        details, err, _ = logging_run(['--no-show-results',
            'failures/expected/missing_image.html',
            'failures/unexpected/missing_text.html',
            'failures/unexpected/text-image-checksum.html'],
            tests_included=True, host=host, port_obj=test_port)
        self.assertEqual(details.exit_code, 2)
开发者ID:Anthony-Biget,项目名称:openjfx,代码行数:16,代码来源:run_webkit_tests_integrationtest.py

示例9: test_missing_and_unexpected_results_with_custom_exit_code

    def test_missing_and_unexpected_results_with_custom_exit_code(self):
        # Test that we update expectations in place. If the expectation
        # is missing, update the expected generic location.
        fs = unit_test_filesystem()

        class CustomExitCodePort(TestPort):
            def exit_code_from_summarized_results(self, unexpected_results):
                return unexpected_results['num_regressions'] + unexpected_results['num_missing']

        options, parsed_args = run_webkit_tests.parse_args(['--pixel-tests', '--no-new-test-results'])
        test_port = CustomExitCodePort(options=options, user=mocktool.MockUser())
        res, out, err, _ = logging_run(['--no-show-results',
            'failures/expected/missing_image.html',
            'failures/unexpected/missing_text.html',
            'failures/unexpected/text-image-checksum.html'],
            tests_included=True, filesystem=fs, record_results=True, port_obj=test_port)
        self.assertEquals(res, 2)
开发者ID:jboylee,项目名称:preprocessor-parser,代码行数:17,代码来源:run_webkit_tests_integrationtest.py

示例10: parse_args

def parse_args(extra_args=None, tests_included=False, new_results=False, print_nothing=True):
    extra_args = extra_args or []
    args = []
    if not '--platform' in extra_args:
        args.extend(['--platform', 'test'])
    if not new_results:
        args.append('--no-new-test-results')

    if not '--child-processes' in extra_args:
        args.extend(['--child-processes', 1])
    args.extend(extra_args)
    if not tests_included:
        # We use the glob to test that globbing works.
        args.extend(['passes',
                     'http/tests',
                     'websocket/tests',
                     'failures/expected/*'])
    return run_webkit_tests.parse_args(args)
开发者ID:Anthony-Biget,项目名称:openjfx,代码行数:18,代码来源:run_webkit_tests_integrationtest.py

示例11: parse_args

def parse_args(extra_args=None, record_results=False, tests_included=False, new_results=False, print_nothing=True):
    extra_args = extra_args or []
    if print_nothing:
        args = ["--print", "nothing"]
    else:
        args = []
    if not "--platform" in extra_args:
        args.extend(["--platform", "test"])
    if not record_results:
        args.append("--no-record-results")
    if not new_results:
        args.append("--no-new-test-results")

    if not "--child-processes" in extra_args and not "--worker-model" in extra_args:
        args.extend(["--worker-model", "inline"])
    args.extend(extra_args)
    if not tests_included:
        # We use the glob to test that globbing works.
        args.extend(["passes", "http/tests", "websocket/tests", "failures/expected/*"])
    return run_webkit_tests.parse_args(args)
开发者ID:jparound30,项目名称:webkit,代码行数:20,代码来源:run_webkit_tests_integrationtest.py

示例12: passing_run

def passing_run(extra_args=None, port_obj=None, record_results=False,
                tests_included=False):
    extra_args = extra_args or []
    args = ['--print', 'nothing']
    if not '--platform' in extra_args:
        args.extend(['--platform', 'test'])
    if not record_results:
        args.append('--no-record-results')
    if not '--child-processes' in extra_args:
        args.extend(['--worker-model', 'inline'])
    args.extend(extra_args)
    if not tests_included:
        # We use the glob to test that globbing works.
        args.extend(['passes',
                     'http/tests',
                     'websocket/tests',
                     'failures/expected/*'])
    options, parsed_args = run_webkit_tests.parse_args(args)
    if not port_obj:
        port_obj = port.get(port_name=options.platform, options=options,
                            user=MockUser())
    res = run_webkit_tests.run(port_obj, options, parsed_args)
    return res == 0
开发者ID:Andersbakken,项目名称:check-coding-style,代码行数:23,代码来源:run_webkit_tests_unittest.py

示例13: test_missing_and_unexpected_results_with_custom_exit_code

    def test_missing_and_unexpected_results_with_custom_exit_code(self):
        # Test that we update expectations in place. If the expectation
        # is missing, update the expected generic location.
        class CustomExitCodePort(TestPort):
            def exit_code_from_summarized_results(self, unexpected_results):
                return unexpected_results["num_regressions"] + unexpected_results["num_missing"]

        host = MockHost()
        options, parsed_args = run_webkit_tests.parse_args(["--pixel-tests", "--no-new-test-results"])
        test_port = CustomExitCodePort(host, options=options)
        res, out, err, _ = logging_run(
            [
                "--no-show-results",
                "failures/expected/missing_image.html",
                "failures/unexpected/missing_text.html",
                "failures/unexpected/text-image-checksum.html",
            ],
            tests_included=True,
            host=host,
            record_results=True,
            port_obj=test_port,
        )
        self.assertEquals(res, 2)
开发者ID:dzhshf,项目名称:WebKit,代码行数:23,代码来源:run_webkit_tests_integrationtest.py

示例14: get_port_for_run

 def get_port_for_run(args):
     options, parsed_args = run_webkit_tests.parse_args(args)
     test_port = ImageDiffTestPort(options=options, user=MockUser())
     passing_run(args, port_obj=test_port, tests_included=True)
     return test_port
开发者ID:Andersbakken,项目名称:check-coding-style,代码行数:5,代码来源:run_webkit_tests_unittest.py

示例15: get_port_for_run

 def get_port_for_run(args):
     options, parsed_args = run_webkit_tests.parse_args(args)
     test_port = ImageDiffTestPort(options=options, user=mocktool.MockUser())
     res = passing_run(args, port_obj=test_port, tests_included=True)
     self.assertTrue(res)
     return test_port
开发者ID:jboylee,项目名称:preprocessor-parser,代码行数:6,代码来源:run_webkit_tests_integrationtest.py


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