| 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 | 10 |
| 11 _SDK_OUT_DIR = os.path.join(constants.CHROME_DIR, 'out') | 11 _SDK_OUT_DIR = os.path.join(constants.CHROME_DIR, 'out') |
| 12 | 12 |
| 13 | 13 |
| 14 def AddBuildTypeOption(option_parser): | 14 def AddBuildTypeOption(option_parser): |
| 15 # TODO(wangxianzhu): Change to Debug when we build Debug by default. | 15 default_build_type = 'Debug' |
| 16 default_build_type = 'Release' | |
| 17 if 'BUILDTYPE' in os.environ: | 16 if 'BUILDTYPE' in os.environ: |
| 18 default_build_type = os.environ['BUILDTYPE'] | 17 default_build_type = os.environ['BUILDTYPE'] |
| 19 option_parser.add_option('--debug', action='store_const', const='Debug', | 18 option_parser.add_option('--debug', action='store_const', const='Debug', |
| 20 dest='build_type', default=default_build_type, | 19 dest='build_type', default=default_build_type, |
| 21 help='If set, run test suites under out/Debug.') | 20 help='If set, run test suites under out/Debug. ' |
| 21 'Default is env var BUILDTYPE or Debug') |
| 22 option_parser.add_option('--release', action='store_const', const='Release', | 22 option_parser.add_option('--release', action='store_const', const='Release', |
| 23 dest='build_type', | 23 dest='build_type', |
| 24 help='If set, run test suites under out/Release.') | 24 help='If set, run test suites under out/Release. ' |
| 25 'Default is env var BUILDTYPE or Debug.') |
| 25 | 26 |
| 26 | 27 |
| 27 def CreateTestRunnerOptionParser(usage=None, default_timeout=60): | 28 def CreateTestRunnerOptionParser(usage=None, default_timeout=60): |
| 28 """Returns a new OptionParser with arguments applicable to all tests.""" | 29 """Returns a new OptionParser with arguments applicable to all tests.""" |
| 29 option_parser = optparse.OptionParser(usage=usage) | 30 option_parser = optparse.OptionParser(usage=usage) |
| 30 option_parser.add_option('-t', dest='timeout', | 31 option_parser.add_option('-t', dest='timeout', |
| 31 help='Timeout to wait for each test', | 32 help='Timeout to wait for each test', |
| 32 type='int', | 33 type='int', |
| 33 default=default_timeout) | 34 default=default_timeout) |
| 34 option_parser.add_option('-c', dest='cleanup_test_files', | 35 option_parser.add_option('-c', dest='cleanup_test_files', |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 '%s.jar' | 124 '%s.jar' |
| 124 % options.test_apk) | 125 % options.test_apk) |
| 125 if options.annotation_str: | 126 if options.annotation_str: |
| 126 options.annotation = options.annotation_str.split() | 127 options.annotation = options.annotation_str.split() |
| 127 elif options.test_filter: | 128 elif options.test_filter: |
| 128 options.annotation = [] | 129 options.annotation = [] |
| 129 else: | 130 else: |
| 130 options.annotation = ['Smoke', 'SmallTest', 'MediumTest', 'LargeTest'] | 131 options.annotation = ['Smoke', 'SmallTest', 'MediumTest', 'LargeTest'] |
| 131 | 132 |
| 132 return options | 133 return options |
| OLD | NEW |