Index: build/android/test_runner.py |
diff --git a/build/android/test_runner.py b/build/android/test_runner.py |
index f79e13e9786f81d71eb4aa2db9d9b1553ceeca12..cede4976b0502549e0308489ff56592f7cb5a25a 100755 |
--- a/build/android/test_runner.py |
+++ b/build/android/test_runner.py |
@@ -20,6 +20,7 @@ from pylib import android_commands |
from pylib import constants |
from pylib import forwarder |
from pylib import ports |
+from pylib.base import base_error |
from pylib.base import base_test_result |
from pylib.base import environment_factory |
from pylib.base import test_dispatcher |
@@ -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,15 @@ 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('An error occured.') |
mikecase (-- gone --)
2015/02/23 22:29:27
Just fyi.
logging.exception WILL print the error
jbudorick
2015/02/23 22:31:29
We could split by infra / non-infra?
What does th
mikecase (-- gone --)
2015/02/23 22:48:22
Wrote a quick example. Output of logging.exception
|
+ if e.is_infra_error: |
+ return constants.INFRA_EXIT_CODE |
+ else: |
+ return constants.ERROR_EXIT_CODE |
if __name__ == '__main__': |