OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 # Copyright 2017 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
| 5 |
| 6 from webkitpy.common.host import Host |
| 7 from webkitpy.w3c.chromium_commit import ChromiumCommit |
| 8 from webkitpy.w3c.chromium_finder import absolute_chromium_dir |
| 9 |
| 10 import os.path |
| 11 |
| 12 # rename to LayoutTests/external/ was on Jan 17 |
| 13 JAN17 = "6506b8b80db745936336bb88855cd078c083691e" |
| 14 JAN31 = "ab70c862d2b27087dd382a65a00001c666550cdd" |
| 15 FEB28 = "480fa30589acd71427e3f902fd7916e87c41f5d9" |
| 16 MAR31 = "2ce4271d950f61c7c3993ee7af1585df9a0b55c2" |
| 17 APR30 = "71f3bd1682b75efac412a7431adae78afb8a903b" |
| 18 MAY15 = "e23bdc0201d0327ae578615fda8674842348999a" |
| 19 |
| 20 NOTEST_DIRS = [ |
| 21 'third_party/WebKit/LayoutTests', |
| 22 'third_party/WebKit/LayoutTests/FlagExpectations', |
| 23 'third_party/WebKit/LayoutTests/external', |
| 24 'third_party/WebKit/LayoutTests/external/wpt', |
| 25 ] |
| 26 |
| 27 def is_source(path): |
| 28 return path.startswith('third_party/WebKit/Source/') |
| 29 |
| 30 def is_test(path): |
| 31 if not path.startswith('third_party/WebKit/LayoutTests/'): |
| 32 return False |
| 33 dirname, basename = os.path.split(path) |
| 34 # TestExpectations, MANIFEST.json, etc. |
| 35 if dirname in NOTEST_DIRS: |
| 36 return False |
| 37 return True |
| 38 |
| 39 def is_in_wpt(path): |
| 40 return path.startswith('third_party/WebKit/LayoutTests/external/wpt/') |
| 41 |
| 42 def main(): |
| 43 host = Host() |
| 44 chromium_dir = absolute_chromium_dir(host) |
| 45 |
| 46 lt_revs = host.executive.run_command([ |
| 47 'git', 'rev-list', '{}..{}'.format(MAR31, APR30), |
| 48 '--', 'third_party/WebKit/LayoutTests', |
| 49 ], cwd=chromium_dir).strip().split() |
| 50 |
| 51 changes = 0 |
| 52 wpt_changes = 0 |
| 53 for sha in lt_revs: |
| 54 changed_files = host.executive.run_command([ |
| 55 'git', 'diff-tree', '--name-only', '--no-commit-id', '-r', sha, |
| 56 '--', 'third_party/WebKit', |
| 57 ], cwd=chromium_dir).splitlines() |
| 58 |
| 59 # ignore commits that do not touch the source |
| 60 if not any((is_source(f) for f in changed_files)): |
| 61 continue |
| 62 |
| 63 test_files = [f for f in changed_files if is_test(f)] |
| 64 |
| 65 if len(test_files) == 0: |
| 66 continue |
| 67 |
| 68 print sha |
| 69 for f in changed_files: |
| 70 print f |
| 71 print |
| 72 |
| 73 changes += 1 |
| 74 |
| 75 if any((is_in_wpt(f) for f in test_files)): |
| 76 wpt_changes += 1 |
| 77 |
| 78 print '{} source+test changes, {} in wpt'.format(changes, wpt_changes) |
| 79 |
| 80 if __name__ == '__main__': |
| 81 main() |
OLD | NEW |