Commit 7ae139e0 authored by mlamouri@chromium.org's avatar mlamouri@chromium.org

Move AddBuildTypeOption to adb_install_apk.py and remove test_options_parser.py

BUG=None

Review URL: https://codereview.chromium.org/292653003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271820 0039d316-1c4b-4281-b951-d872f2087c98
parent 31e43d8d
...@@ -15,12 +15,10 @@ from pylib import android_commands ...@@ -15,12 +15,10 @@ from pylib import android_commands
from pylib import constants from pylib import constants
from pylib.device import device_utils from pylib.device import device_utils
from pylib.utils import apk_helper from pylib.utils import apk_helper
from pylib.utils import test_options_parser
def AddInstallAPKOption(option_parser): def AddInstallAPKOption(option_parser):
"""Adds apk option used to install the APK to the OptionParser.""" """Adds apk option used to install the APK to the OptionParser."""
test_options_parser.AddBuildTypeOption(option_parser)
option_parser.add_option('--apk', option_parser.add_option('--apk',
help=('The name of the apk containing the ' help=('The name of the apk containing the '
' application (with the .apk extension).')) ' application (with the .apk extension).'))
...@@ -32,6 +30,15 @@ def AddInstallAPKOption(option_parser): ...@@ -32,6 +30,15 @@ def AddInstallAPKOption(option_parser):
default=False, default=False,
help=('Keep the package data when installing ' help=('Keep the package data when installing '
'the application.')) 'the application.'))
option_parser.add_option('--debug', action='store_const', const='Debug',
dest='build_type',
default=os.environ.get('BUILDTYPE', 'Debug'),
help='If set, run test suites under out/Debug. '
'Default is env var BUILDTYPE or Debug')
option_parser.add_option('--release', action='store_const', const='Release',
dest='build_type',
help='If set, run test suites under out/Release. '
'Default is env var BUILDTYPE or Debug.')
def ValidateInstallAPKOption(option_parser, options): def ValidateInstallAPKOption(option_parser, options):
......
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Parses options for the instrumentation tests."""
import os
# TODO(gkanwar): Some downstream scripts current rely on these functions
# existing. This dependency should be removed, and this file deleted, in the
# future.
def AddBuildTypeOption(option_parser):
"""Decorates OptionParser with build type option."""
default_build_type = 'Debug'
if 'BUILDTYPE' in os.environ:
default_build_type = os.environ['BUILDTYPE']
option_parser.add_option('--debug', action='store_const', const='Debug',
dest='build_type', default=default_build_type,
help='If set, run test suites under out/Debug. '
'Default is env var BUILDTYPE or Debug')
option_parser.add_option('--release', action='store_const', const='Release',
dest='build_type',
help='If set, run test suites under out/Release. '
'Default is env var BUILDTYPE or Debug.')
def AddTestRunnerOptions(option_parser, default_timeout=60):
"""Decorates OptionParser with options applicable to all tests."""
option_parser.add_option('-t', dest='timeout',
help='Timeout to wait for each test',
type='int',
default=default_timeout)
option_parser.add_option('-c', dest='cleanup_test_files',
help='Cleanup test files on the device after run',
action='store_true')
option_parser.add_option('--num_retries', dest='num_retries', type='int',
default=2,
help='Number of retries for a test before '
'giving up.')
option_parser.add_option('-v',
'--verbose',
dest='verbose_count',
default=0,
action='count',
help='Verbose level (multiple times for more)')
profilers = ['devicestatsmonitor', 'chrometrace', 'dumpheap', 'smaps',
'traceview']
option_parser.add_option('--profiler', dest='profilers', action='append',
choices=profilers,
help='Profiling tool to run during test. '
'Pass multiple times to run multiple profilers. '
'Available profilers: %s' % profilers)
option_parser.add_option('--tool',
dest='tool',
help='Run the test under a tool '
'(use --tool help to list them)')
option_parser.add_option('--flakiness-dashboard-server',
dest='flakiness_dashboard_server',
help=('Address of the server that is hosting the '
'Chrome for Android flakiness dashboard.'))
option_parser.add_option('--skip-deps-push', dest='push_deps',
action='store_false', default=True,
help='Do not push dependencies to the device. '
'Use this at own risk for speeding up test '
'execution on local machine.')
AddBuildTypeOption(option_parser)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment