OLD | NEW |
(Empty) | |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 """Parses options for the instrumentation tests.""" |
| 6 |
| 7 import os |
| 8 import optparse |
| 9 |
| 10 |
| 11 def CreateTestRunnerOptionParser(usage=None, default_timeout=60): |
| 12 """Returns a new OptionParser with arguments applicable to all tests.""" |
| 13 option_parser = optparse.OptionParser(usage=usage) |
| 14 option_parser.add_option('-t', dest='timeout', |
| 15 help='Timeout to wait for each test', |
| 16 type='int', |
| 17 default=default_timeout) |
| 18 option_parser.add_option('-c', dest='cleanup_test_files', |
| 19 help='Cleanup test files on the device after run', |
| 20 action='store_true', |
| 21 default=False) |
| 22 option_parser.add_option('-v', |
| 23 '--verbose', |
| 24 dest='verbose_count', |
| 25 default=0, |
| 26 action='count', |
| 27 help='Verbose level (multiple times for more)') |
| 28 profilers = ['activitymonitor', 'chrometrace', 'dumpheap', 'smaps', |
| 29 'traceview'] |
| 30 option_parser.add_option('--profiler', dest='profilers', action='append', |
| 31 choices=profilers, |
| 32 help='Profiling tool to run during test. ' |
| 33 'Pass multiple times to run multiple profilers. ' |
| 34 'Available profilers: %s' % profilers) |
| 35 option_parser.add_option('--tool', |
| 36 dest='tool', |
| 37 help='Run the test under a tool ' |
| 38 '(use --tool help to list them)') |
| 39 return option_parser |
OLD | NEW |