| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Parses options for the instrumentation tests.""" | 5 """Parses options for the instrumentation tests.""" |
| 6 | 6 |
| 7 import constants | 7 import constants |
| 8 import optparse | 8 import optparse |
| 9 import os | 9 import os |
| 10 import sys | 10 import sys |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 option_parser.add_option('--save-perf-json', action='store_true', | 102 option_parser.add_option('--save-perf-json', action='store_true', |
| 103 help='Saves the JSON file for each UI Perf test.') | 103 help='Saves the JSON file for each UI Perf test.') |
| 104 option_parser.add_option('--shard_retries', type=int, default=1, | 104 option_parser.add_option('--shard_retries', type=int, default=1, |
| 105 help=('Number of times to retry each failure when ' | 105 help=('Number of times to retry each failure when ' |
| 106 'sharding.')) | 106 'sharding.')) |
| 107 option_parser.add_option('--official-build', help='Run official build tests.') | 107 option_parser.add_option('--official-build', help='Run official build tests.') |
| 108 option_parser.add_option('--device', | 108 option_parser.add_option('--device', |
| 109 help='Serial number of device we should use.') | 109 help='Serial number of device we should use.') |
| 110 option_parser.add_option('--python_test_root', | 110 option_parser.add_option('--python_test_root', |
| 111 help='Root of the python-driven tests.') | 111 help='Root of the python-driven tests.') |
| 112 option_parser.add_option('--flakiness-dashboard-server', |
| 113 dest='flakiness_dashboard_server', |
| 114 help=('Address of the server that is hosting the ' |
| 115 'Chrome for Android flakiness dashboard.')) |
| 112 | 116 |
| 113 def ValidateInstrumentationOptions(option_parser, options, args): | 117 def ValidateInstrumentationOptions(option_parser, options, args): |
| 114 """Validate options/arguments and populate options with defaults.""" | 118 """Validate options/arguments and populate options with defaults.""" |
| 115 if len(args) > 1: | 119 if len(args) > 1: |
| 116 option_parser.print_help(sys.stderr) | 120 option_parser.print_help(sys.stderr) |
| 117 option_parser.error('Unknown arguments: %s' % args[1:]) | 121 option_parser.error('Unknown arguments: %s' % args[1:]) |
| 118 if options.java_only and options.python_only: | 122 if options.java_only and options.python_only: |
| 119 option_parser.error('Options java_only (-j) and python_only (-p) ' | 123 option_parser.error('Options java_only (-j) and python_only (-p) ' |
| 120 'are mutually exclusive.') | 124 'are mutually exclusive.') |
| 121 | 125 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 134 options.test_apk_jar_path = os.path.join(_SDK_OUT_DIR, | 138 options.test_apk_jar_path = os.path.join(_SDK_OUT_DIR, |
| 135 options.build_type, | 139 options.build_type, |
| 136 constants.SDK_BUILD_TEST_JAVALIB_DIR, | 140 constants.SDK_BUILD_TEST_JAVALIB_DIR, |
| 137 '%s-debug.jar' % options.test_apk) | 141 '%s-debug.jar' % options.test_apk) |
| 138 if options.annotation_str: | 142 if options.annotation_str: |
| 139 options.annotation = options.annotation_str.split() | 143 options.annotation = options.annotation_str.split() |
| 140 elif options.test_filter: | 144 elif options.test_filter: |
| 141 options.annotation = [] | 145 options.annotation = [] |
| 142 else: | 146 else: |
| 143 options.annotation = ['Smoke', 'SmallTest', 'MediumTest', 'LargeTest'] | 147 options.annotation = ['Smoke', 'SmallTest', 'MediumTest', 'LargeTest'] |
| OLD | NEW |