Chromium Code Reviews| 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 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1024 # Assume it's an absolute path and normalize. | 1024 # Assume it's an absolute path and normalize. |
| 1025 options.results_directory = path_utils.GetAbsolutePath( | 1025 options.results_directory = path_utils.GetAbsolutePath( |
| 1026 options.results_directory) | 1026 options.results_directory) |
| 1027 else: | 1027 else: |
| 1028 # If it's a relative path, make the output directory relative to Debug or | 1028 # If it's a relative path, make the output directory relative to Debug or |
| 1029 # Release. | 1029 # Release. |
| 1030 basedir = path_utils.PathFromBase('webkit') | 1030 basedir = path_utils.PathFromBase('webkit') |
| 1031 options.results_directory = path_utils.GetAbsolutePath( | 1031 options.results_directory = path_utils.GetAbsolutePath( |
| 1032 os.path.join(basedir, options.target, options.results_directory)) | 1032 os.path.join(basedir, options.target, options.results_directory)) |
| 1033 | 1033 |
| 1034 if options.clobber_old_results: | |
| 1035 # Just clobber the actual test results directories since the other files | |
| 1036 # in the results directory are explicitly used for cross-run tracking. | |
| 1037 test_dirs = ["LayoutTests", "chrome", "pending"] | |
|
tony
2009/11/02 19:36:54
Nit: Use () instead of [] to make it immutable.
| |
| 1038 for directory in test_dirs: | |
| 1039 path = os.path.join(options.results_directory, directory) | |
| 1040 if os.path.exists(path): | |
| 1041 shutil.rmtree(path) | |
| 1042 | |
| 1034 # Ensure platform is valid and force it to the form 'chromium-<platform>'. | 1043 # Ensure platform is valid and force it to the form 'chromium-<platform>'. |
| 1035 options.platform = path_utils.PlatformName(options.platform) | 1044 options.platform = path_utils.PlatformName(options.platform) |
| 1036 | 1045 |
| 1037 if not options.num_test_shells: | 1046 if not options.num_test_shells: |
| 1038 cpus = 1 | 1047 cpus = 1 |
| 1039 if sys.platform in ('win32', 'cygwin'): | 1048 if sys.platform in ('win32', 'cygwin'): |
| 1040 cpus = int(os.environ.get('NUMBER_OF_PROCESSORS', 1)) | 1049 cpus = int(os.environ.get('NUMBER_OF_PROCESSORS', 1)) |
| 1041 elif (hasattr(os, "sysconf") and | 1050 elif (hasattr(os, "sysconf") and |
| 1042 os.sysconf_names.has_key("SC_NPROCESSORS_ONLN")): | 1051 os.sysconf_names.has_key("SC_NPROCESSORS_ONLN")): |
| 1043 # Linux & Unix: | 1052 # Linux & Unix: |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1166 default=False, | 1175 default=False, |
| 1167 help="save all generated results as new baselines " | 1176 help="save all generated results as new baselines " |
| 1168 "into the platform directory, overwriting " | 1177 "into the platform directory, overwriting " |
| 1169 "whatever's already there.") | 1178 "whatever's already there.") |
| 1170 option_parser.add_option("", "--noshow-results", action="store_true", | 1179 option_parser.add_option("", "--noshow-results", action="store_true", |
| 1171 default=False, help="don't launch the test_shell" | 1180 default=False, help="don't launch the test_shell" |
| 1172 " with results after the tests are done") | 1181 " with results after the tests are done") |
| 1173 option_parser.add_option("", "--full-results-html", action="store_true", | 1182 option_parser.add_option("", "--full-results-html", action="store_true", |
| 1174 default=False, help="show all failures in " | 1183 default=False, help="show all failures in " |
| 1175 "results.html, rather than only regressions") | 1184 "results.html, rather than only regressions") |
| 1185 option_parser.add_option("", "--clobber-old-results", action="store_true", | |
| 1186 default=False, help="Clobbers test results from " | |
| 1187 "previous runs.") | |
| 1176 option_parser.add_option("", "--lint-test-files", action="store_true", | 1188 option_parser.add_option("", "--lint-test-files", action="store_true", |
| 1177 default=False, help="Makes sure the test files " | 1189 default=False, help="Makes sure the test files " |
| 1178 "parse for all configurations. Does not run any " | 1190 "parse for all configurations. Does not run any " |
| 1179 "tests.") | 1191 "tests.") |
| 1180 option_parser.add_option("", "--force", action="store_true", | 1192 option_parser.add_option("", "--force", action="store_true", |
| 1181 default=False, | 1193 default=False, |
| 1182 help="Run all tests, even those marked SKIP in the " | 1194 help="Run all tests, even those marked SKIP in the " |
| 1183 "test list") | 1195 "test list") |
| 1184 option_parser.add_option("", "--nocompare-failures", action="store_true", | 1196 option_parser.add_option("", "--nocompare-failures", action="store_true", |
| 1185 default=False, | 1197 default=False, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1256 "this script.")) | 1268 "this script.")) |
| 1257 option_parser.add_option("", "--find-baselines", action="store_true", | 1269 option_parser.add_option("", "--find-baselines", action="store_true", |
| 1258 default=False, | 1270 default=False, |
| 1259 help="Prints a table mapping tests to their " | 1271 help="Prints a table mapping tests to their " |
| 1260 "expected results") | 1272 "expected results") |
| 1261 option_parser.add_option("", "--experimental-fully-parallel", | 1273 option_parser.add_option("", "--experimental-fully-parallel", |
| 1262 action="store_true", default=False, | 1274 action="store_true", default=False, |
| 1263 help="run all tests in parallel") | 1275 help="run all tests in parallel") |
| 1264 options, args = option_parser.parse_args() | 1276 options, args = option_parser.parse_args() |
| 1265 main(options, args) | 1277 main(options, args) |
| OLD | NEW |