當前位置: 首頁>>代碼示例>>Python>>正文


Python test_expectations.TestExpectationParser類代碼示例

本文整理匯總了Python中webkitpy.layout_tests.models.test_expectations.TestExpectationParser的典型用法代碼示例。如果您正苦於以下問題:Python TestExpectationParser類的具體用法?Python TestExpectationParser怎麽用?Python TestExpectationParser使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了TestExpectationParser類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: GardeningExpectationsUpdater

class GardeningExpectationsUpdater(BugManager):
    def __init__(self, tool, port):
        self._converter = TestConfigurationConverter(port.all_test_configurations(), port.configuration_specifier_macros())
        self._extrapolator = BuildCoverageExtrapolator(self._converter)
        self._parser = TestExpectationParser(port, [], allow_rebaseline_modifier=False)
        self._path_to_test_expectations_file = port.path_to_test_expectations_file()
        self._tool = tool

    def close_bug(self, bug_id, reference_bug_id=None):
        # FIXME: Implement this properly.
        pass

    def create_bug(self):
        return "BUG_NEW"

    def update_expectations(self, failure_info_list):
        expectation_lines = TestExpectationParser.tokenize_list(self._tool.filesystem.read_text_file(self._path_to_test_expectations_file))
        for expectation_line in expectation_lines:
            self._parser.parse(expectation_line)
        editor = TestExpectationsEditor(expectation_lines, self)
        updated_expectation_lines = []
        # FIXME: Group failures by testName+failureTypeList.
        for failure_info in failure_info_list:
            expectation_set = set(filter(lambda expectation: expectation is not None,
                                         map(TestExpectations.expectation_from_string, failure_info['failureTypeList'])))
            assert(expectation_set)
            test_name = failure_info['testName']
            assert(test_name)
            builder_name = failure_info['builderName']
            affected_test_configuration_set = self._extrapolator.extrapolate_test_configurations(builder_name)
            updated_expectation_lines.extend(editor.update_expectation(test_name, affected_test_configuration_set, expectation_set))
        self._tool.filesystem.write_text_file(self._path_to_test_expectations_file, TestExpectationSerializer.list_to_string(expectation_lines, self._converter, reconstitute_only_these=updated_expectation_lines))
開發者ID:jboylee,項目名稱:preprocessor-parser,代碼行數:32,代碼來源:gardeningserver.py

示例2: check_test_expectations

    def check_test_expectations(self, expectations_str, tests=None):
        parser = TestExpectationParser(self._port_obj, tests, allow_rebaseline_modifier=False)
        expectations = parser.parse('expectations', expectations_str)

        level = 5
        for expectation_line in expectations:
            for warning in expectation_line.warnings:
                self._handle_style_error(expectation_line.line_number, 'test/expectations', level, warning)
開發者ID:BrianGFlores,項目名稱:android_external_svmp_fbstream,代碼行數:8,代碼來源:test_expectations.py

示例3: check_test_expectations

    def check_test_expectations(self, expectations_str, tests=None):
        parser = TestExpectationParser(self._port_obj, tests, is_lint_mode=True)
        expectations = parser.parse("expectations", expectations_str)

        level = 5
        for expectation_line in expectations:
            for warning in expectation_line.warnings:
                self._handle_style_error(expectation_line.line_numbers, "test/expectations", level, warning)
開發者ID:venkatarajasekhar,項目名稱:Qt,代碼行數:8,代碼來源:test_expectations.py

示例4: execute

 def execute(self, options, args, tool):
     port = factory.get("chromium-win-win7")  # FIXME: This should be selectable.
     expectation_lines = TestExpectationParser.tokenize_list(port.test_expectations())
     parser = TestExpectationParser(port, [], allow_rebaseline_modifier=False)
     for expectation_line in expectation_lines:
         parser.parse(expectation_line)
     converter = TestConfigurationConverter(port.all_test_configurations(), port.configuration_specifier_macros())
     tool.filesystem.write_text_file(port.path_to_test_expectations_file(), TestExpectationSerializer.list_to_string(expectation_lines, converter))
開發者ID:Andolamin,項目名稱:LunaSysMgr,代碼行數:8,代碼來源:expectations.py

示例5: update_all_test_expectations_files

    def update_all_test_expectations_files(self, deleted_tests, renamed_tests):
        """Updates all test expectations files for tests that have been deleted or renamed."""
        port = self.host.port_factory.get()
        for path, file_contents in port.all_expectations_dict().iteritems():

            parser = TestExpectationParser(port, all_tests=None, is_lint_mode=False)
            expectation_lines = parser.parse(path, file_contents)
            self._update_single_test_expectations_file(path, expectation_lines, deleted_tests, renamed_tests)
開發者ID:ollie314,項目名稱:chromium,代碼行數:8,代碼來源:deps_updater.py

示例6: _init_paths_from_expectations

 def _init_paths_from_expectations(self, file_path):
     if not self._filesystem.isfile(file_path):
         _log.warning("Unable to read import expectation file: %s" % file_path)
         return
     parser = TestExpectationParser(self._host.port_factory.get(), (), False)
     for line in parser.parse(file_path, self._filesystem.read_text_file(file_path)):
         if "SKIP" in line.modifiers:
             self.paths_to_skip.append(line.name)
         elif "PASS" in line.expectations:
             self.paths_to_import.append(line.name)
開發者ID:rhythmkay,項目名稱:webkit,代碼行數:10,代碼來源:test_downloader.py

示例7: find_paths_to_skip

    def find_paths_to_skip(self):
        if self.options.ignore_expectations:
            return set()

        paths_to_skip = set()
        port = self.host.port_factory.get()
        w3c_import_expectations_path = self.webkit_finder.path_from_webkit_base('LayoutTests', 'W3CImportExpectations')
        w3c_import_expectations = self.filesystem.read_text_file(w3c_import_expectations_path)
        parser = TestExpectationParser(port, full_test_list=(), is_lint_mode=False)
        expectation_lines = parser.parse(w3c_import_expectations_path, w3c_import_expectations)
        for line in expectation_lines:
            if 'SKIP' in line.expectations:
                if line.specifiers:
                    _log.warning("W3CImportExpectations:%s should not have any specifiers" % line.line_numbers)
                    continue
                paths_to_skip.add(line.name)
        return paths_to_skip
開發者ID:venkatarajasekhar,項目名稱:Qt,代碼行數:17,代碼來源:test_importer.py

示例8: __init__

 def __init__(self, tool, port):
     self._converter = TestConfigurationConverter(
         port.all_test_configurations(), port.configuration_specifier_macros()
     )
     self._extrapolator = BuildCoverageExtrapolator(self._converter)
     self._parser = TestExpectationParser(port, [], allow_rebaseline_modifier=False)
     self._path_to_test_expectations_file = port.path_to_test_expectations_file()
     self._tool = tool
開發者ID:Spencerx,項目名稱:webkit,代碼行數:8,代碼來源:gardeningserver.py

示例9: update_expectations

 def update_expectations(self, failure_info_list):
     expectation_lines = TestExpectationParser.tokenize_list(self._tool.filesystem.read_text_file(self._path_to_test_expectations_file))
     for expectation_line in expectation_lines:
         self._parser.parse(expectation_line)
     editor = TestExpectationsEditor(expectation_lines, self)
     updated_expectation_lines = []
     # FIXME: Group failures by testName+failureTypeList.
     for failure_info in failure_info_list:
         expectation_set = set(filter(lambda expectation: expectation is not None,
                                      map(TestExpectations.expectation_from_string, failure_info['failureTypeList'])))
         assert(expectation_set)
         test_name = failure_info['testName']
         assert(test_name)
         builder_name = failure_info['builderName']
         affected_test_configuration_set = self._extrapolator.extrapolate_test_configurations(builder_name)
         updated_expectation_lines.extend(editor.update_expectation(test_name, affected_test_configuration_set, expectation_set))
     self._tool.filesystem.write_text_file(self._path_to_test_expectations_file, TestExpectationSerializer.list_to_string(expectation_lines, self._converter, reconstitute_only_these=updated_expectation_lines))
開發者ID:jboylee,項目名稱:preprocessor-parser,代碼行數:17,代碼來源:gardeningserver.py


注:本文中的webkitpy.layout_tests.models.test_expectations.TestExpectationParser類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。