summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorfrankf@google.com <frankf@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-18 17:32:11 +0000
committerfrankf@google.com <frankf@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-18 17:32:11 +0000
commit591373aeeb06e8278fecc80fbdda8eba89106fe4 (patch)
tree092367e9cec9cbf7f8bcf9a0badbd2b268e5b042 /build
parent09c00eaf6463380b7bd6be9ef3c7a8aaf9cab8d0 (diff)
downloadchromium_src-591373aeeb06e8278fecc80fbdda8eba89106fe4.zip
chromium_src-591373aeeb06e8278fecc80fbdda8eba89106fe4.tar.gz
chromium_src-591373aeeb06e8278fecc80fbdda8eba89106fe4.tar.bz2
Fix ValidateInstrumentationOptions.
BUG= Review URL: https://codereview.chromium.org/10928240 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157374 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r--build/android/pylib/test_options_parser.py9
-rwxr-xr-xbuild/android/run_instrumentation_tests.py3
2 files changed, 7 insertions, 5 deletions
diff --git a/build/android/pylib/test_options_parser.py b/build/android/pylib/test_options_parser.py
index f082274..8492ec3 100644
--- a/build/android/pylib/test_options_parser.py
+++ b/build/android/pylib/test_options_parser.py
@@ -7,6 +7,7 @@
import constants
import optparse
import os
+import sys
_SDK_OUT_DIR = os.path.join(constants.CHROME_DIR, 'out')
@@ -102,13 +103,14 @@ def AddInstrumentationOptions(option_parser):
option_parser.add_option('--python_test_root',
help='Root of the python-driven tests.')
-def ValidateInstrumentationOptions(options, args):
+def ValidateInstrumentationOptions(option_parser, options, args):
"""Validate options/arguments and populate options with defaults."""
if len(args) > 1:
- option_parser.error('Unknown argument:', args[1:])
+ option_parser.print_help(sys.stderr)
+ option_parser.error('Unknown arguments: %s' % args[1:])
if options.java_only and options.python_only:
option_parser.error('Options java_only (-j) and python_only (-p) '
- 'are mutually exclusive')
+ 'are mutually exclusive.')
options.run_java_tests = True
options.run_python_tests = True
@@ -130,4 +132,3 @@ def ValidateInstrumentationOptions(options, args):
options.annotation = []
else:
options.annotation = ['Smoke', 'SmallTest', 'MediumTest', 'LargeTest']
-
diff --git a/build/android/run_instrumentation_tests.py b/build/android/run_instrumentation_tests.py
index 5a0b171..43c3ae6 100755
--- a/build/android/run_instrumentation_tests.py
+++ b/build/android/run_instrumentation_tests.py
@@ -73,7 +73,8 @@ def main(argv):
option_parser = optparse.OptionParser()
test_options_parser.AddInstrumentationOptions(option_parser)
options, args = option_parser.parse_args(argv)
- test_options_parser.ValidateInstrumentationOptions(options, args)
+ test_options_parser.ValidateInstrumentationOptions(option_parser, options,
+ args)
run_tests_helper.SetLogLevel(options.verbose_count)
buildbot_report.PrintNamedStep('Instrumentation tests: %s'