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

Unified Diff: build/android/test_runner.py

Issue 988693005: Chromium roll (https://codereview.chromium.org/976353002) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: fixed bad android build patch Created 5 years, 9 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 | « build/android/pylib/utils/base_error.py ('k') | build/apk_test.gypi » ('j') | 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 f79e13e9786f81d71eb4aa2db9d9b1553ceeca12..368ac06aff109931487a0f4b1497f16e292a2f4c 100755
--- a/build/android/test_runner.py
+++ b/build/android/test_runner.py
@@ -44,6 +44,7 @@ from pylib.results import report_results
from pylib.uiautomator import setup as uiautomator_setup
from pylib.uiautomator import test_options as uiautomator_test_options
from pylib.utils import apk_helper
+from pylib.utils import base_error
from pylib.utils import reraiser_thread
from pylib.utils import run_tests_helper
@@ -957,7 +958,7 @@ def RunTestsInPlatformMode(args, parser):
json_results.GenerateJsonResultsFile(
results, args.json_results_file)
- return 0 if results.DidRunPass() else 1
+ return 0 if results.DidRunPass() else constants.ERROR_EXIT_CODE
CommandConfigTuple = collections.namedtuple(
@@ -1013,7 +1014,18 @@ def main():
config.add_options_func(subparser)
args = parser.parse_args()
- return RunTestsCommand(args, parser)
+
+ try:
+ return RunTestsCommand(args, parser)
+ except base_error.BaseError as e:
+ logging.exception('Error occurred.')
+ if e.is_infra_error:
+ return constants.INFRA_EXIT_CODE
+ else:
+ return constants.ERROR_EXIT_CODE
+ except: # pylint: disable=W0702
+ logging.exception('Unrecognized error occurred.')
+ return constants.ERROR_EXIT_CODE
if __name__ == '__main__':
« no previous file with comments | « build/android/pylib/utils/base_error.py ('k') | build/apk_test.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698