| OLD | NEW |
| 1 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 1 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions | 4 # modification, are permitted provided that the following conditions |
| 5 # are met: | 5 # are met: |
| 6 # | 6 # |
| 7 # 1. Redistributions of source code must retain the above | 7 # 1. Redistributions of source code must retain the above |
| 8 # copyright notice, this list of conditions and the following | 8 # copyright notice, this list of conditions and the following |
| 9 # disclaimer. | 9 # disclaimer. |
| 10 # 2. Redistributions in binary form must reproduce the above | 10 # 2. Redistributions in binary form must reproduce the above |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 removed in the newer changesets. The script removes these files accordingly. | 64 removed in the newer changesets. The script removes these files accordingly. |
| 65 """ | 65 """ |
| 66 | 66 |
| 67 import logging | 67 import logging |
| 68 import mimetypes | 68 import mimetypes |
| 69 import optparse | 69 import optparse |
| 70 import os | 70 import os |
| 71 import sys | 71 import sys |
| 72 | 72 |
| 73 from webkitpy.common.host import Host | 73 from webkitpy.common.host import Host |
| 74 from webkitpy.common.webkit_finder import WebKitFinder | 74 from webkitpy.common.blink_finder import BlinkFinder |
| 75 from webkitpy.layout_tests.models.test_expectations import TestExpectationParser | 75 from webkitpy.layout_tests.models.test_expectations import TestExpectationParser |
| 76 from webkitpy.w3c.test_parser import TestParser | 76 from webkitpy.w3c.test_parser import TestParser |
| 77 from webkitpy.w3c.test_converter import convert_for_webkit | 77 from webkitpy.w3c.test_converter import convert_for_webkit |
| 78 | 78 |
| 79 | 79 |
| 80 # Maximum length of import path starting from top of source repository. | 80 # Maximum length of import path starting from top of source repository. |
| 81 # This limit is here because the Windows builders cannot create paths that are | 81 # This limit is here because the Windows builders cannot create paths that are |
| 82 # longer than the Windows max path length (260). See http://crbug.com/609871. | 82 # longer than the Windows max path length (260). See http://crbug.com/609871. |
| 83 MAX_PATH_LENGTH = 125 | 83 MAX_PATH_LENGTH = 125 |
| 84 | 84 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 | 139 |
| 140 class TestImporter(object): | 140 class TestImporter(object): |
| 141 | 141 |
| 142 def __init__(self, host, source_repo_path, options): | 142 def __init__(self, host, source_repo_path, options): |
| 143 self.host = host | 143 self.host = host |
| 144 self.source_repo_path = source_repo_path | 144 self.source_repo_path = source_repo_path |
| 145 self.options = options | 145 self.options = options |
| 146 | 146 |
| 147 self.filesystem = self.host.filesystem | 147 self.filesystem = self.host.filesystem |
| 148 self.webkit_finder = WebKitFinder(self.filesystem) | 148 self.blink_finder = BlinkFinder(self.filesystem) |
| 149 self._webkit_root = self.webkit_finder.webkit_base() | 149 self._webkit_root = self.blink_finder.blink_base() |
| 150 self.layout_tests_dir = self.webkit_finder.path_from_webkit_base('Layout
Tests') | 150 self.layout_tests_dir = self.blink_finder.path_from_blink_base('LayoutTe
sts') |
| 151 self.destination_directory = self.filesystem.normpath( | 151 self.destination_directory = self.filesystem.normpath( |
| 152 self.filesystem.join( | 152 self.filesystem.join( |
| 153 self.layout_tests_dir, | 153 self.layout_tests_dir, |
| 154 options.destination, | 154 options.destination, |
| 155 self.filesystem.basename(self.source_repo_path))) | 155 self.filesystem.basename(self.source_repo_path))) |
| 156 self.import_in_place = (self.source_repo_path == self.destination_direct
ory) | 156 self.import_in_place = (self.source_repo_path == self.destination_direct
ory) |
| 157 self.dir_above_repo = self.filesystem.dirname(self.source_repo_path) | 157 self.dir_above_repo = self.filesystem.dirname(self.source_repo_path) |
| 158 | 158 |
| 159 self.import_list = [] | 159 self.import_list = [] |
| 160 | 160 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 # Only add this directory to the list if there's something to im
port | 289 # Only add this directory to the list if there's something to im
port |
| 290 self.import_list.append({'dirname': root, 'copy_list': copy_list
, | 290 self.import_list.append({'dirname': root, 'copy_list': copy_list
, |
| 291 'reftests': reftests, 'jstests': jstest
s, 'total_tests': total_tests}) | 291 'reftests': reftests, 'jstests': jstest
s, 'total_tests': total_tests}) |
| 292 | 292 |
| 293 def find_paths_to_skip(self): | 293 def find_paths_to_skip(self): |
| 294 if self.options.ignore_expectations: | 294 if self.options.ignore_expectations: |
| 295 return set() | 295 return set() |
| 296 | 296 |
| 297 paths_to_skip = set() | 297 paths_to_skip = set() |
| 298 port = self.host.port_factory.get() | 298 port = self.host.port_factory.get() |
| 299 w3c_import_expectations_path = self.webkit_finder.path_from_webkit_base(
'LayoutTests', 'W3CImportExpectations') | 299 w3c_import_expectations_path = self.blink_finder.path_from_blink_base('L
ayoutTests', 'W3CImportExpectations') |
| 300 w3c_import_expectations = self.filesystem.read_text_file(w3c_import_expe
ctations_path) | 300 w3c_import_expectations = self.filesystem.read_text_file(w3c_import_expe
ctations_path) |
| 301 parser = TestExpectationParser(port, all_tests=(), is_lint_mode=False) | 301 parser = TestExpectationParser(port, all_tests=(), is_lint_mode=False) |
| 302 expectation_lines = parser.parse(w3c_import_expectations_path, w3c_impor
t_expectations) | 302 expectation_lines = parser.parse(w3c_import_expectations_path, w3c_impor
t_expectations) |
| 303 for line in expectation_lines: | 303 for line in expectation_lines: |
| 304 if 'SKIP' in line.expectations: | 304 if 'SKIP' in line.expectations: |
| 305 if line.specifiers: | 305 if line.specifiers: |
| 306 _log.warning("W3CImportExpectations:%s should not have any s
pecifiers", line.line_numbers) | 306 _log.warning("W3CImportExpectations:%s should not have any s
pecifiers", line.line_numbers) |
| 307 continue | 307 continue |
| 308 paths_to_skip.add(line.name) | 308 paths_to_skip.add(line.name) |
| 309 return paths_to_skip | 309 return paths_to_skip |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 """Checks whether a source path is too long to import. | 414 """Checks whether a source path is too long to import. |
| 415 | 415 |
| 416 Args: | 416 Args: |
| 417 Absolute path of file to be imported. | 417 Absolute path of file to be imported. |
| 418 | 418 |
| 419 Returns: | 419 Returns: |
| 420 True if the path is too long to import, False if it's OK. | 420 True if the path is too long to import, False if it's OK. |
| 421 """ | 421 """ |
| 422 path_from_repo_base = os.path.relpath(source_path, self.source_repo_path
) | 422 path_from_repo_base = os.path.relpath(source_path, self.source_repo_path
) |
| 423 return len(path_from_repo_base) > MAX_PATH_LENGTH | 423 return len(path_from_repo_base) > MAX_PATH_LENGTH |
| OLD | NEW |