| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Run layout tests using the test_shell. | 6 """Run layout tests using the test_shell. |
| 7 | 7 |
| 8 This is a port of the existing webkit test script run-webkit-tests. | 8 This is a port of the existing webkit test script run-webkit-tests. |
| 9 | 9 |
| 10 The TestRunner class runs a series of tests (TestType interface) against a set | 10 The TestRunner class runs a series of tests (TestType interface) against a set |
| (...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 wontfix_failures = set() | 783 wontfix_failures = set() |
| 784 | 784 |
| 785 # Aggregate failures in a dictionary (TestFailure -> frequency), | 785 # Aggregate failures in a dictionary (TestFailure -> frequency), |
| 786 # with known (fixable and wontfix) failures separated out. | 786 # with known (fixable and wontfix) failures separated out. |
| 787 def AddFailure(dictionary, key): | 787 def AddFailure(dictionary, key): |
| 788 if key in dictionary: | 788 if key in dictionary: |
| 789 dictionary[key] += 1 | 789 dictionary[key] += 1 |
| 790 else: | 790 else: |
| 791 dictionary[key] = 1 | 791 dictionary[key] = 1 |
| 792 | 792 |
| 793 for test, failures in failures.iteritems(): | 793 for test, failure_types in failures.iteritems(): |
| 794 for failure in failures: | 794 for failure_type in failure_types: |
| 795 # TODO(ojan): Now that we have IMAGE+TEXT, IMAGE and TEXT, | 795 # TODO(ojan): Now that we have IMAGE+TEXT, IMAGE and TEXT, |
| 796 # we can avoid adding multiple failures per test since there should | 796 # we can avoid adding multiple failures per test since there should |
| 797 # be a unique type of failure for each test. This would make the | 797 # be a unique type of failure for each test. This would make the |
| 798 # statistics printed at the end easier to grok. | 798 # statistics printed at the end easier to grok. |
| 799 if self._expectations.IsDeferred(test): | 799 if self._expectations.IsDeferred(test): |
| 800 count_group = deferred_counts | 800 count_group = deferred_counts |
| 801 failure_group = deferred_failures | 801 failure_group = deferred_failures |
| 802 elif self._expectations.IsIgnored(test): | 802 elif self._expectations.IsIgnored(test): |
| 803 count_group = wontfix_counts | 803 count_group = wontfix_counts |
| 804 failure_group = wontfix_failures | 804 failure_group = wontfix_failures |
| 805 else: | 805 else: |
| 806 count_group = fixable_counts | 806 count_group = fixable_counts |
| 807 failure_group = fixable_failures | 807 failure_group = fixable_failures |
| 808 | 808 |
| 809 AddFailure(count_group, failure.__class__) | 809 AddFailure(count_group, failure_type.__class__) |
| 810 failure_group.add(test) | 810 failure_group.add(test) |
| 811 | 811 |
| 812 # Here and below, use the prechuncked expectations object for numbers of | 812 # Here and below, use the prechuncked expectations object for numbers of |
| 813 # skipped tests. Chunking removes the skipped tests before creating the | 813 # skipped tests. Chunking removes the skipped tests before creating the |
| 814 # expectations file. | 814 # expectations file. |
| 815 # | 815 # |
| 816 # This is a bit inaccurate, since the number of skipped tests will be | 816 # This is a bit inaccurate, since the number of skipped tests will be |
| 817 # duplicated across all shard, but it's the best we can reasonably do. | 817 # duplicated across all shard, but it's the best we can reasonably do. |
| 818 | 818 |
| 819 deduped_fixable_count = len(fixable_failures | | 819 deduped_fixable_count = len(fixable_failures | |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1256 "this script.")) | 1256 "this script.")) |
| 1257 option_parser.add_option("", "--find-baselines", action="store_true", | 1257 option_parser.add_option("", "--find-baselines", action="store_true", |
| 1258 default=False, | 1258 default=False, |
| 1259 help="Prints a table mapping tests to their " | 1259 help="Prints a table mapping tests to their " |
| 1260 "expected results") | 1260 "expected results") |
| 1261 option_parser.add_option("", "--experimental-fully-parallel", | 1261 option_parser.add_option("", "--experimental-fully-parallel", |
| 1262 action="store_true", default=False, | 1262 action="store_true", default=False, |
| 1263 help="run all tests in parallel") | 1263 help="run all tests in parallel") |
| 1264 options, args = option_parser.parse_args() | 1264 options, args = option_parser.parse_args() |
| 1265 main(options, args) | 1265 main(options, args) |
| OLD | NEW |