| OLD | NEW |
| 1 #!/bin/env python | 1 #!/bin/env python |
| 2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2008 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 if self._options.lint_test_files: | 154 if self._options.lint_test_files: |
| 155 test_files = None | 155 test_files = None |
| 156 else: | 156 else: |
| 157 test_files = self._test_files | 157 test_files = self._test_files |
| 158 | 158 |
| 159 try: | 159 try: |
| 160 return test_expectations.TestExpectations(test_files, | 160 return test_expectations.TestExpectations(test_files, |
| 161 self._file_dir, | 161 self._file_dir, |
| 162 platform, | 162 platform, |
| 163 is_debug_mode) | 163 is_debug_mode) |
| 164 except SyntaxError, err: | 164 except Exception, err: |
| 165 if self._options.lint_test_files: | 165 if self._options.lint_test_files: |
| 166 print str(err) | 166 print str(err) |
| 167 else: | 167 else: |
| 168 raise err | 168 raise err |
| 169 | 169 |
| 170 def _PrepareListsAndPrintOutput(self): | 170 def _PrepareListsAndPrintOutput(self): |
| 171 """Create appropriate subsets of test lists and print test counts. | 171 """Create appropriate subsets of test lists and print test counts. |
| 172 | 172 |
| 173 Create appropriate subsets of self._tests_files in | 173 Create appropriate subsets of self._tests_files in |
| 174 self._ignored_failures, self._fixable_failures, and self._fixable_crashes. | 174 self._ignored_failures, self._fixable_failures, and self._fixable_crashes. |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 paths = [] | 668 paths = [] |
| 669 if options.test_list: | 669 if options.test_list: |
| 670 paths += ReadTestFiles(options.test_list) | 670 paths += ReadTestFiles(options.test_list) |
| 671 if not paths: | 671 if not paths: |
| 672 paths = ['.'] | 672 paths = ['.'] |
| 673 | 673 |
| 674 test_runner = TestRunner(options, paths) | 674 test_runner = TestRunner(options, paths) |
| 675 | 675 |
| 676 if options.lint_test_files: | 676 if options.lint_test_files: |
| 677 # Just creating the TestRunner checks the syntax of the test lists. | 677 # Just creating the TestRunner checks the syntax of the test lists. |
| 678 print "If there are no fail messages, the lint succeeded." | 678 print "If there are no fail messages or exceptions, the lint succeeded." |
| 679 return | 679 return |
| 680 | 680 |
| 681 try: | 681 try: |
| 682 test_shell_binary_path = path_utils.TestShellBinaryPath(options.target) | 682 test_shell_binary_path = path_utils.TestShellBinaryPath(options.target) |
| 683 except: | 683 except: |
| 684 print "\nERROR: test_shell is not found. Be sure that you have built it" | 684 print "\nERROR: test_shell is not found. Be sure that you have built it" |
| 685 print "and that you are using the correct build. This script will run the" | 685 print "and that you are using the correct build. This script will run the" |
| 686 print "Release one by default. Use --debug to use the Debug build.\n" | 686 print "Release one by default. Use --debug to use the Debug build.\n" |
| 687 sys.exit(1) | 687 sys.exit(1) |
| 688 | 688 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 option_parser.add_option("", "--run-chunk", | 803 option_parser.add_option("", "--run-chunk", |
| 804 default=None, | 804 default=None, |
| 805 help=("Run a specified chunk (n:l), the nth of len l" | 805 help=("Run a specified chunk (n:l), the nth of len l" |
| 806 ", of the layout tests")) | 806 ", of the layout tests")) |
| 807 option_parser.add_option("", "--batch-size", | 807 option_parser.add_option("", "--batch-size", |
| 808 default=None, | 808 default=None, |
| 809 help=("Run a the tests in batches (n), after every " | 809 help=("Run a the tests in batches (n), after every " |
| 810 "n tests, the test shell is relaunched.")) | 810 "n tests, the test shell is relaunched.")) |
| 811 options, args = option_parser.parse_args() | 811 options, args = option_parser.parse_args() |
| 812 main(options, args) | 812 main(options, args) |
| OLD | NEW |