Chromium Code Reviews| 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 | 238 |
| 239 if self.filesystem.basename(root) in DIRS_TO_INCLUDE: | 239 if self.filesystem.basename(root) in DIRS_TO_INCLUDE: |
| 240 copy_list.append({'src': fullpath, 'dest': filename}) | 240 copy_list.append({'src': fullpath, 'dest': filename}) |
| 241 continue | 241 continue |
| 242 | 242 |
| 243 test_parser = TestParser(vars(self.options), filename=fullpath) | 243 test_parser = TestParser(vars(self.options), filename=fullpath) |
| 244 test_info = test_parser.analyze_test() | 244 test_info = test_parser.analyze_test() |
| 245 if test_info is None: | 245 if test_info is None: |
| 246 continue | 246 continue |
| 247 | 247 |
| 248 if self.path_too_long(path_full): | |
| 249 _log.warning('%s skipped due to long path. ' | |
| 250 'Max length from repo base %d chars; see http:/ /crbug.com/609871.', | |
| 251 path_full, MAX_PATH_LENGTH) | |
| 252 continue | |
|
qyearsley
2016/05/20 21:09:46
The skipping has been moved from import_tests to f
| |
| 253 | |
| 248 if 'reference' in test_info.keys(): | 254 if 'reference' in test_info.keys(): |
| 249 reftests += 1 | |
| 250 total_tests += 1 | |
| 251 test_basename = self.filesystem.basename(test_info['test']) | 255 test_basename = self.filesystem.basename(test_info['test']) |
| 252 | |
| 253 # Add the ref file, following WebKit style. | 256 # Add the ref file, following WebKit style. |
| 254 # FIXME: Ideally we'd support reading the metadata | 257 # FIXME: Ideally we'd support reading the metadata |
| 255 # directly rather than relying on a naming convention. | 258 # directly rather than relying on a naming convention. |
| 256 # Using a naming convention creates duplicate copies of the | 259 # Using a naming convention creates duplicate copies of the |
| 257 # reference files. | 260 # reference files. |
| 258 ref_file = self.filesystem.splitext(test_basename)[0] + '-ex pected' | 261 ref_file = self.filesystem.splitext(test_basename)[0] + '-ex pected' |
| 259 # Make sure to use the extension from the *reference*, not | 262 # Make sure to use the extension from the *reference*, not |
| 260 # from the test, because at least flexbox tests use XHTML | 263 # from the test, because at least flexbox tests use XHTML |
| 261 # references but HTML tests. | 264 # references but HTML tests. |
| 262 ref_file += self.filesystem.splitext(test_info['reference']) [1] | 265 ref_file += self.filesystem.splitext(test_info['reference']) [1] |
| 263 | 266 |
| 267 if self.path_too_long(path_full.replace(filename, ref_file)) : | |
| 268 _log.warning('%s skipped because path of ref file %s wou ld be too long. ' | |
| 269 'Max length from repo base %d chars; see ht tp://crbug.com/609871.', | |
| 270 path_full, ref_file, MAX_PATH_LENGTH) | |
| 271 continue | |
|
qyearsley
2016/05/20 21:09:46
This should skip importing in the case where the p
| |
| 272 | |
| 273 reftests += 1 | |
| 274 total_tests += 1 | |
| 264 copy_list.append({'src': test_info['reference'], 'dest': ref _file, | 275 copy_list.append({'src': test_info['reference'], 'dest': ref _file, |
| 265 'reference_support_info': test_info['refer ence_support_info']}) | 276 'reference_support_info': test_info['refer ence_support_info']}) |
| 266 copy_list.append({'src': test_info['test'], 'dest': filename }) | 277 copy_list.append({'src': test_info['test'], 'dest': filename }) |
| 267 | 278 |
| 268 elif 'jstest' in test_info.keys(): | 279 elif 'jstest' in test_info.keys(): |
| 269 jstests += 1 | 280 jstests += 1 |
| 270 total_tests += 1 | 281 total_tests += 1 |
| 271 copy_list.append({'src': fullpath, 'dest': filename}) | 282 copy_list.append({'src': fullpath, 'dest': filename}) |
| 272 else: | 283 else: |
| 273 total_tests += 1 | 284 total_tests += 1 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 328 | 339 |
| 329 if self.filesystem.isdir(orig_filepath): | 340 if self.filesystem.isdir(orig_filepath): |
| 330 # FIXME: Figure out what is triggering this and what to do a bout it. | 341 # FIXME: Figure out what is triggering this and what to do a bout it. |
| 331 _log.error('%s refers to a directory' % orig_filepath) | 342 _log.error('%s refers to a directory' % orig_filepath) |
| 332 continue | 343 continue |
| 333 | 344 |
| 334 if not self.filesystem.exists(orig_filepath): | 345 if not self.filesystem.exists(orig_filepath): |
| 335 _log.warning('%s not found. Possible error in the test.', or ig_filepath) | 346 _log.warning('%s not found. Possible error in the test.', or ig_filepath) |
| 336 continue | 347 continue |
| 337 | 348 |
| 338 if self.path_too_long(orig_filepath): | |
| 339 _log.warning('%s skipped (longer than %d chars), to avoid hi tting Windows max path length on builders (http://crbug.com/609871).', | |
| 340 orig_filepath, MAX_PATH_LENGTH) | |
| 341 continue | |
| 342 | |
| 343 new_filepath = self.filesystem.join(new_path, file_to_copy['dest ']) | 349 new_filepath = self.filesystem.join(new_path, file_to_copy['dest ']) |
| 344 if 'reference_support_info' in file_to_copy.keys() and file_to_c opy['reference_support_info'] != {}: | 350 if 'reference_support_info' in file_to_copy.keys() and file_to_c opy['reference_support_info'] != {}: |
| 345 reference_support_info = file_to_copy['reference_support_inf o'] | 351 reference_support_info = file_to_copy['reference_support_inf o'] |
| 346 else: | 352 else: |
| 347 reference_support_info = None | 353 reference_support_info = None |
| 348 | 354 |
| 349 if not self.filesystem.exists(self.filesystem.dirname(new_filepa th)): | 355 if not self.filesystem.exists(self.filesystem.dirname(new_filepa th)): |
| 350 if not self.import_in_place and not self.options.dry_run: | 356 if not self.import_in_place and not self.options.dry_run: |
| 351 self.filesystem.maybe_make_directory(self.filesystem.dir name(new_filepath)) | 357 self.filesystem.maybe_make_directory(self.filesystem.dir name(new_filepath)) |
| 352 | 358 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 412 """ Creates a destination directory that mirrors that of the source dire ctory """ | 418 """ Creates a destination directory that mirrors that of the source dire ctory """ |
| 413 | 419 |
| 414 new_subpath = self.dir_to_import[len(self.top_of_repo):] | 420 new_subpath = self.dir_to_import[len(self.top_of_repo):] |
| 415 | 421 |
| 416 destination_directory = self.filesystem.join(self.destination_directory, new_subpath) | 422 destination_directory = self.filesystem.join(self.destination_directory, new_subpath) |
| 417 | 423 |
| 418 if not self.filesystem.exists(destination_directory): | 424 if not self.filesystem.exists(destination_directory): |
| 419 self.filesystem.maybe_make_directory(destination_directory) | 425 self.filesystem.maybe_make_directory(destination_directory) |
| 420 | 426 |
| 421 _log.info('Tests will be imported into: %s', destination_directory) | 427 _log.info('Tests will be imported into: %s', destination_directory) |
| OLD | NEW |