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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 option_parser.add_option('-j', '--java_only', action='store_true', | 78 option_parser.add_option('-j', '--java_only', action='store_true', |
79 help='Run only the Java tests.') | 79 help='Run only the Java tests.') |
80 option_parser.add_option('-p', '--python_only', action='store_true', | 80 option_parser.add_option('-p', '--python_only', action='store_true', |
81 help='Run only the Python tests.') | 81 help='Run only the Python tests.') |
82 option_parser.add_option('-n', '--run_count', type='int', | 82 option_parser.add_option('-n', '--run_count', type='int', |
83 dest='number_of_runs', default=1, | 83 dest='number_of_runs', default=1, |
84 help=('How many times to run each test, regardless ' | 84 help=('How many times to run each test, regardless ' |
85 'of the result. (Default is 1)')) | 85 'of the result. (Default is 1)')) |
86 option_parser.add_option('--test-apk', dest='test_apk', | 86 option_parser.add_option('--test-apk', dest='test_apk', |
87 help=('The name of the apk containing the tests ' | 87 help=('The name of the apk containing the tests ' |
88 '(without the .apk extension) or for SDK ' | 88 '(without the .apk extension). For SDK ' |
89 'builds, the path to the APK from ' | 89 'builds, the apk name without the debug ' |
90 'out/(Debug|Release) (for example, ' | 90 'suffix(for example, ContentShellTest).')) |
91 'content_shell_test/ContentShellTest-debug).')) | |
92 option_parser.add_option('--screenshot', dest='screenshot_failures', | 91 option_parser.add_option('--screenshot', dest='screenshot_failures', |
93 action='store_true', | 92 action='store_true', |
94 help='Capture screenshots of test failures') | 93 help='Capture screenshots of test failures') |
95 option_parser.add_option('--save-perf-json', action='store_true', | 94 option_parser.add_option('--save-perf-json', action='store_true', |
96 help='Saves the JSON file for each UI Perf test.') | 95 help='Saves the JSON file for each UI Perf test.') |
97 option_parser.add_option('--shard_retries', type=int, default=1, | 96 option_parser.add_option('--shard_retries', type=int, default=1, |
98 help=('Number of times to retry each failure when ' | 97 help=('Number of times to retry each failure when ' |
99 'sharding.')) | 98 'sharding.')) |
100 option_parser.add_option('--official-build', help='Run official build tests.') | 99 option_parser.add_option('--official-build', help='Run official build tests.') |
101 option_parser.add_option('--device', | 100 option_parser.add_option('--device', |
(...skipping 10 matching lines...) Expand all Loading... |
112 option_parser.error('Options java_only (-j) and python_only (-p) ' | 111 option_parser.error('Options java_only (-j) and python_only (-p) ' |
113 'are mutually exclusive.') | 112 'are mutually exclusive.') |
114 | 113 |
115 options.run_java_tests = True | 114 options.run_java_tests = True |
116 options.run_python_tests = True | 115 options.run_python_tests = True |
117 if options.java_only: | 116 if options.java_only: |
118 options.run_python_tests = False | 117 options.run_python_tests = False |
119 elif options.python_only: | 118 elif options.python_only: |
120 options.run_java_tests = False | 119 options.run_java_tests = False |
121 | 120 |
| 121 # In case of SDK Build, the jars and apks have a -debug suffix. |
122 options.test_apk_path = os.path.join(_SDK_OUT_DIR, | 122 options.test_apk_path = os.path.join(_SDK_OUT_DIR, |
123 options.build_type, | 123 options.build_type, |
124 '%s.apk' % options.test_apk) | 124 constants.SDK_BUILD_APKS_DIR, |
| 125 '%s-debug.apk' % options.test_apk) |
125 options.test_apk_jar_path = os.path.join(_SDK_OUT_DIR, | 126 options.test_apk_jar_path = os.path.join(_SDK_OUT_DIR, |
126 options.build_type, | 127 options.build_type, |
127 '%s.jar' | 128 constants.SDK_BUILD_TEST_JAVALIB_DIR, |
128 % options.test_apk) | 129 '%s-debug.jar' % options.test_apk) |
129 if options.annotation_str: | 130 if options.annotation_str: |
130 options.annotation = options.annotation_str.split() | 131 options.annotation = options.annotation_str.split() |
131 elif options.test_filter: | 132 elif options.test_filter: |
132 options.annotation = [] | 133 options.annotation = [] |
133 else: | 134 else: |
134 options.annotation = ['Smoke', 'SmallTest', 'MediumTest', 'LargeTest'] | 135 options.annotation = ['Smoke', 'SmallTest', 'MediumTest', 'LargeTest'] |
OLD | NEW |