Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Tools / Scripts / check-testharness-expected-pass
1 #!/usr/bin/env python
2 #
3 # Copyright 2014 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 """Check if a LayoutTest expected file is a passing testharness result.
8
9 The intent of this script is to identify expected files that are passing
10 testharness.js results. Those files are not needed because the test
11 infrastructure will read the output of testharness.js tests if there is no
12 expected files."""
13
14
15 import fileinput
16 import sys
17
18 from webkitpy.layout_tests.models import testharness_results
19
20 paths = []
21
22 for path in sys.argv[1:]:
23     content = open(path, 'r').read()
24     if testharness_results.is_testharness_output(content) and \
25        testharness_results.is_testharness_output_passing(content):
26         paths.append(path)
27
28 if len(paths) > 0:
29     sys.stderr.write('* The following files are passing testharness results, they should be removed:\n ')
30     sys.stderr.write('\n '.join(paths))
31     sys.stderr.write('\n')
32     sys.exit("ERROR: found passing testharness results.")