OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 # chrome_tests.py | 6 # chrome_tests.py |
7 | 7 |
8 ''' Runs various chrome tests through valgrind_test.py.''' | 8 ''' Runs various chrome tests through valgrind_test.py.''' |
9 | 9 |
10 import glob | 10 import glob |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 out_dir = os.path.join(path_utils.ScriptDir(), "latest") | 343 out_dir = os.path.join(path_utils.ScriptDir(), "latest") |
344 out_dir = os.path.join(out_dir, chunk_dir) | 344 out_dir = os.path.join(out_dir, chunk_dir) |
345 if os.path.exists(out_dir): | 345 if os.path.exists(out_dir): |
346 old_files = glob.glob(os.path.join(out_dir, "*.txt")) | 346 old_files = glob.glob(os.path.join(out_dir, "*.txt")) |
347 for f in old_files: | 347 for f in old_files: |
348 os.remove(f) | 348 os.remove(f) |
349 else: | 349 else: |
350 os.makedirs(out_dir) | 350 os.makedirs(out_dir) |
351 script = os.path.join(self._source_dir, "webkit", "tools", "layout_tests", | 351 script = os.path.join(self._source_dir, "webkit", "tools", "layout_tests", |
352 "run_webkit_tests.py") | 352 "run_webkit_tests.py") |
353 script_cmd = ["python", script, "--run-singly", "-v", | 353 script_cmd = ["python", script, "-v", |
354 "--noshow-results", "--time-out-ms=200000", | 354 "--run-singly", # run a separate DumpRenderTree for each test |
| 355 "--experimental-fully-parallel", |
| 356 "--time-out-ms=200000", |
| 357 "--noshow-results", |
355 "--nocheck-sys-deps"] | 358 "--nocheck-sys-deps"] |
356 # Pass build mode to run_webkit_tests.py. We aren't passed it directly, | 359 # Pass build mode to run_webkit_tests.py. We aren't passed it directly, |
357 # so parse it out of build_dir. run_webkit_tests.py can only handle | 360 # so parse it out of build_dir. run_webkit_tests.py can only handle |
358 # the two values "Release" and "Debug". | 361 # the two values "Release" and "Debug". |
359 # TODO(Hercules): unify how all our scripts pass around build mode | 362 # TODO(Hercules): unify how all our scripts pass around build mode |
360 # (--mode / --target / --build_dir / --debug) | 363 # (--mode / --target / --build_dir / --debug) |
361 if self._options.build_dir.endswith("Debug"): | 364 if self._options.build_dir.endswith("Debug"): |
362 script_cmd.append("--debug"); | 365 script_cmd.append("--debug"); |
363 if (chunk_size > 0): | 366 if (chunk_size > 0): |
364 script_cmd.append("--run-chunk=%d:%d" % (chunk_num, chunk_size)) | 367 script_cmd.append("--run-chunk=%d:%d" % (chunk_num, chunk_size)) |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 help="verbose output - enable debug log messages") | 478 help="verbose output - enable debug log messages") |
476 parser.add_option("", "--tool", dest="valgrind_tool", default="memcheck", | 479 parser.add_option("", "--tool", dest="valgrind_tool", default="memcheck", |
477 help="specify a valgrind tool to run the tests under") | 480 help="specify a valgrind tool to run the tests under") |
478 parser.add_option("", "--tool_flags", dest="valgrind_tool_flags", default="", | 481 parser.add_option("", "--tool_flags", dest="valgrind_tool_flags", default="", |
479 help="specify custom flags for the selected valgrind tool") | 482 help="specify custom flags for the selected valgrind tool") |
480 parser.add_option("", "--keep_logs", action="store_true", default=False, | 483 parser.add_option("", "--keep_logs", action="store_true", default=False, |
481 help="store memory tool logs in the <tool>.logs directory " | 484 help="store memory tool logs in the <tool>.logs directory " |
482 "instead of /tmp.\nThis can be useful for tool " | 485 "instead of /tmp.\nThis can be useful for tool " |
483 "developers/maintainers.\nPlease note that the <tool>" | 486 "developers/maintainers.\nPlease note that the <tool>" |
484 ".logs directory will be clobbered on tool startup.") | 487 ".logs directory will be clobbered on tool startup.") |
485 # My machine can do about 120 layout tests/hour in release mode. | 488 parser.add_option("-n", "--num_tests", default=200, type="int", |
486 # Let's do 30 minutes worth per run. | |
487 # The CPU is mostly idle, so perhaps we can raise this when | |
488 # we figure out how to run them more efficiently. | |
489 parser.add_option("-n", "--num_tests", default=60, type="int", | |
490 help="for layout tests: # of subtests per run. 0 for all.") | 489 help="for layout tests: # of subtests per run. 0 for all.") |
491 | 490 |
492 options, args = parser.parse_args() | 491 options, args = parser.parse_args() |
493 | 492 |
494 if options.verbose: | 493 if options.verbose: |
495 logging_utils.config_root(logging.DEBUG) | 494 logging_utils.config_root(logging.DEBUG) |
496 else: | 495 else: |
497 logging_utils.config_root() | 496 logging_utils.config_root() |
498 | 497 |
499 if not options.test: | 498 if not options.test: |
500 parser.error("--test not specified") | 499 parser.error("--test not specified") |
501 | 500 |
502 if len(options.test) != 1 and options.gtest_filter: | 501 if len(options.test) != 1 and options.gtest_filter: |
503 parser.error("--gtest_filter and multiple tests don't make sense together") | 502 parser.error("--gtest_filter and multiple tests don't make sense together") |
504 | 503 |
505 for t in options.test: | 504 for t in options.test: |
506 tests = ChromeTests(options, args, t) | 505 tests = ChromeTests(options, args, t) |
507 ret = tests.Run() | 506 ret = tests.Run() |
508 if ret: return ret | 507 if ret: return ret |
509 return 0 | 508 return 0 |
510 | 509 |
511 | 510 |
512 if __name__ == "__main__": | 511 if __name__ == "__main__": |
513 ret = _main(sys.argv) | 512 ret = _main(sys.argv) |
514 sys.exit(ret) | 513 sys.exit(ret) |
OLD | NEW |