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

Unified Diff: build/android/test_runner.py

Issue 1666983002: test_runner.py Fix error message being intertwined with log messages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 435624d9afcd94d0345180df7f80e0349a2af9c9..4be90b5693239aa3223dd5ab62450e4868ffaa6d 100755
--- a/build/android/test_runner.py
+++ b/build/android/test_runner.py
@@ -913,12 +913,11 @@ def _GetAttachedDevices(blacklist_file, test_device, enable_cache):
return sorted(attached_devices)
-def RunTestsCommand(args, parser): # pylint: disable=too-many-return-statements
+def RunTestsCommand(args): # pylint: disable=too-many-return-statements
"""Checks test type and dispatches to the appropriate function.
Args:
args: argparse.Namespace object.
- parser: argparse.ArgumentParser object.
Returns:
Integer indicated exit code.
@@ -932,7 +931,7 @@ def RunTestsCommand(args, parser): # pylint: disable=too-many-return-statements
ProcessCommonOptions(args)
if args.enable_platform_mode:
- return RunTestsInPlatformMode(args, parser)
+ return RunTestsInPlatformMode(args)
forwarder.Forwarder.RemoveHostLog()
if not ports.ResetTestServerPortAllocation():
@@ -943,7 +942,7 @@ def RunTestsCommand(args, parser): # pylint: disable=too-many-return-statements
args.enable_device_cache)
if command == 'gtest':
- return RunTestsInPlatformMode(args, parser)
+ return RunTestsInPlatformMode(args)
elif command == 'linker':
return _RunLinkerTests(args, get_devices())
elif command == 'instrumentation':
@@ -968,10 +967,11 @@ _SUPPORTED_IN_PLATFORM_MODE = [
]
-def RunTestsInPlatformMode(args, parser):
+def RunTestsInPlatformMode(args):
def infra_error(message):
- parser.exit(status=constants.INFRA_EXIT_CODE, message=message)
+ logging.fatal(message)
+ sys.exit(constants.INFRA_EXIT_CODE)
if args.command not in _SUPPORTED_IN_PLATFORM_MODE:
infra_error('%s is not yet supported in platform mode' % args.command)
@@ -1088,7 +1088,7 @@ def main():
args = parser.parse_args()
try:
- return RunTestsCommand(args, parser)
+ return RunTestsCommand(args)
except base_error.BaseError as e:
logging.exception('Error occurred.')
if e.is_infra_error:
« 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