| Index: third_party/WebKit/Tools/Scripts/wpt-export-stats
|
| diff --git a/third_party/WebKit/Tools/Scripts/wpt-export-stats b/third_party/WebKit/Tools/Scripts/wpt-export-stats
|
| new file mode 100755
|
| index 0000000000000000000000000000000000000000..4b32c9f4ae3cbd5ad525d5605117bf6052f4c22e
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Tools/Scripts/wpt-export-stats
|
| @@ -0,0 +1,81 @@
|
| +#!/usr/bin/env python
|
| +# Copyright 2017 The Chromium Authors. All rights reserved.
|
| +# Use of this source code is governed by a BSD-style license that can be
|
| +# found in the LICENSE file.
|
| +
|
| +from webkitpy.common.host import Host
|
| +from webkitpy.w3c.chromium_commit import ChromiumCommit
|
| +from webkitpy.w3c.chromium_finder import absolute_chromium_dir
|
| +
|
| +import os.path
|
| +
|
| +# rename to LayoutTests/external/ was on Jan 17
|
| +JAN17 = "6506b8b80db745936336bb88855cd078c083691e"
|
| +JAN31 = "ab70c862d2b27087dd382a65a00001c666550cdd"
|
| +FEB28 = "480fa30589acd71427e3f902fd7916e87c41f5d9"
|
| +MAR31 = "2ce4271d950f61c7c3993ee7af1585df9a0b55c2"
|
| +APR30 = "71f3bd1682b75efac412a7431adae78afb8a903b"
|
| +MAY15 = "e23bdc0201d0327ae578615fda8674842348999a"
|
| +
|
| +NOTEST_DIRS = [
|
| + 'third_party/WebKit/LayoutTests',
|
| + 'third_party/WebKit/LayoutTests/FlagExpectations',
|
| + 'third_party/WebKit/LayoutTests/external',
|
| + 'third_party/WebKit/LayoutTests/external/wpt',
|
| +]
|
| +
|
| +def is_source(path):
|
| + return path.startswith('third_party/WebKit/Source/')
|
| +
|
| +def is_test(path):
|
| + if not path.startswith('third_party/WebKit/LayoutTests/'):
|
| + return False
|
| + dirname, basename = os.path.split(path)
|
| + # TestExpectations, MANIFEST.json, etc.
|
| + if dirname in NOTEST_DIRS:
|
| + return False
|
| + return True
|
| +
|
| +def is_in_wpt(path):
|
| + return path.startswith('third_party/WebKit/LayoutTests/external/wpt/')
|
| +
|
| +def main():
|
| + host = Host()
|
| + chromium_dir = absolute_chromium_dir(host)
|
| +
|
| + lt_revs = host.executive.run_command([
|
| + 'git', 'rev-list', '{}..{}'.format(MAR31, APR30),
|
| + '--', 'third_party/WebKit/LayoutTests',
|
| + ], cwd=chromium_dir).strip().split()
|
| +
|
| + changes = 0
|
| + wpt_changes = 0
|
| + for sha in lt_revs:
|
| + changed_files = host.executive.run_command([
|
| + 'git', 'diff-tree', '--name-only', '--no-commit-id', '-r', sha,
|
| + '--', 'third_party/WebKit',
|
| + ], cwd=chromium_dir).splitlines()
|
| +
|
| + # ignore commits that do not touch the source
|
| + if not any((is_source(f) for f in changed_files)):
|
| + continue
|
| +
|
| + test_files = [f for f in changed_files if is_test(f)]
|
| +
|
| + if len(test_files) == 0:
|
| + continue
|
| +
|
| + print sha
|
| + for f in changed_files:
|
| + print f
|
| + print
|
| +
|
| + changes += 1
|
| +
|
| + if any((is_in_wpt(f) for f in test_files)):
|
| + wpt_changes += 1
|
| +
|
| + print '{} source+test changes, {} in wpt'.format(changes, wpt_changes)
|
| +
|
| +if __name__ == '__main__':
|
| + main()
|
|
|