Commit 590426ed authored by tony@chromium.org's avatar tony@chromium.org

Remove dedup-tests.py (it has moved upstream) and 2 empty

directories.
Review URL: http://codereview.chromium.org/6263015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72686 0039d316-1c4b-4281-b951-d872f2087c98
parent 438aaae4
#!/usr/bin/python
# Copyright (c) 2009 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.
"""dedup-tests -- print test results duplicated between win and linux.
Because the outputs are very similar, we fall back on Windows outputs
if there isn't an expected output for Linux layout tests. This means
that any file that is duplicated between the Linux and Windows directories
is redundant.
This command dumps out all such files. You can use it like:
dedup-tests.py # print out the bad files
dedup-tests.py | xargs git rm # delete the bad files
"""
import collections
import os.path
import subprocess
import sys
# A map of file hash => set of all files with that hash.
hashes = collections.defaultdict(set)
# Fill in the map.
cmd = ['git', 'ls-tree', '-r', 'HEAD', 'webkit/data/layout_tests/']
try:
git = subprocess.Popen(cmd, stdout=subprocess.PIPE)
except OSError, e:
if e.errno == 2: # No such file or directory.
print >> sys.stderr, "Error: 'No such file' when running git."
print >> sys.stderr, "This script requires git."
sys.exit(1)
raise e
for line in git.stdout:
attrs, file = line.strip().split('\t')
_, _, hash = attrs.split(' ')
hashes[hash].add(file)
# Dump out duplicated files.
for cluster in hashes.values():
if len(cluster) < 2:
continue
for file in cluster:
if '/chromium-linux/' in file:
if file.replace('/chromium-linux/', '/chromium-win/') in cluster:
print file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment