| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env 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 ''' Runs various chrome tests through valgrind_test.py.''' | 6 ''' Runs various chrome tests through valgrind_test.py.''' |
| 7 | 7 |
| 8 import glob | 8 import glob |
| 9 import logging | 9 import logging |
| 10 import optparse | 10 import optparse |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 help="verbose output - enable debug log messages") | 490 help="verbose output - enable debug log messages") |
| 491 parser.add_option("", "--tool", dest="valgrind_tool", default="memcheck", | 491 parser.add_option("", "--tool", dest="valgrind_tool", default="memcheck", |
| 492 help="specify a valgrind tool to run the tests under") | 492 help="specify a valgrind tool to run the tests under") |
| 493 parser.add_option("", "--tool_flags", dest="valgrind_tool_flags", default="", | 493 parser.add_option("", "--tool_flags", dest="valgrind_tool_flags", default="", |
| 494 help="specify custom flags for the selected valgrind tool") | 494 help="specify custom flags for the selected valgrind tool") |
| 495 parser.add_option("", "--keep_logs", action="store_true", default=False, | 495 parser.add_option("", "--keep_logs", action="store_true", default=False, |
| 496 help="store memory tool logs in the <tool>.logs directory " | 496 help="store memory tool logs in the <tool>.logs directory " |
| 497 "instead of /tmp.\nThis can be useful for tool " | 497 "instead of /tmp.\nThis can be useful for tool " |
| 498 "developers/maintainers.\nPlease note that the <tool>" | 498 "developers/maintainers.\nPlease note that the <tool>" |
| 499 ".logs directory will be clobbered on tool startup.") | 499 ".logs directory will be clobbered on tool startup.") |
| 500 parser.add_option("-n", "--num_tests", default=200, type="int", | 500 parser.add_option("-n", "--num_tests", default=500, type="int", |
| 501 help="for layout tests: # of subtests per run. 0 for all.") | 501 help="for layout tests: # of subtests per run. 0 for all.") |
| 502 | 502 |
| 503 options, args = parser.parse_args() | 503 options, args = parser.parse_args() |
| 504 | 504 |
| 505 if options.verbose: | 505 if options.verbose: |
| 506 logging_utils.config_root(logging.DEBUG) | 506 logging_utils.config_root(logging.DEBUG) |
| 507 else: | 507 else: |
| 508 logging_utils.config_root() | 508 logging_utils.config_root() |
| 509 | 509 |
| 510 if not options.test: | 510 if not options.test: |
| 511 parser.error("--test not specified") | 511 parser.error("--test not specified") |
| 512 | 512 |
| 513 if len(options.test) != 1 and options.gtest_filter: | 513 if len(options.test) != 1 and options.gtest_filter: |
| 514 parser.error("--gtest_filter and multiple tests don't make sense together") | 514 parser.error("--gtest_filter and multiple tests don't make sense together") |
| 515 | 515 |
| 516 for t in options.test: | 516 for t in options.test: |
| 517 tests = ChromeTests(options, args, t) | 517 tests = ChromeTests(options, args, t) |
| 518 ret = tests.Run() | 518 ret = tests.Run() |
| 519 if ret: return ret | 519 if ret: return ret |
| 520 return 0 | 520 return 0 |
| 521 | 521 |
| 522 | 522 |
| 523 if __name__ == "__main__": | 523 if __name__ == "__main__": |
| 524 sys.exit(_main()) | 524 sys.exit(_main()) |
| OLD | NEW |