Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(568)

Unified Diff: build/android/test_runner.py

Issue 18617003: Adds errors on extra positional args (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/test_runner.py
diff --git a/build/android/test_runner.py b/build/android/test_runner.py
index 08a0be33ada010a99c2a48c4173f7c0adaf9bac6..08bd4166b2e1701af1f8373e69e763a89a04c9f4 100755
--- a/build/android/test_runner.py
+++ b/build/android/test_runner.py
@@ -369,6 +369,11 @@ def RunTestsCommand(command, options, args, option_parser):
individual test runner.
"""
+ # Check for extra arguments
+ if len(args) > 2:
+ option_parser.error('Unrecognized arguments: %s' % (' '.join(args[2:])))
+ return constants.ERROR_EXIT_CODE
+
ProcessCommonOptions(options)
if command == 'gtest':
@@ -443,6 +448,10 @@ def HelpCommand(command, options, args, option_parser):
if len(args) < 3:
option_parser.print_help()
return 0
+ # If we have too many args, print an error
+ if len(args) > 3:
+ option_parser.error('Unrecognized arguments: %s' % (' '.join(args[3:])))
+ return constants.ERROR_EXIT_CODE
command = args[2]
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698