Index: build/android/pylib/base/base_test_result.py |
diff --git a/build/android/pylib/base/base_test_result.py b/build/android/pylib/base/base_test_result.py |
index ba438e1788f146aecdfbc1f8e231a2788db2be71..b757dc98c361a17e62ddc2a0c97354a6d8006d67 100644 |
--- a/build/android/pylib/base/base_test_result.py |
+++ b/build/android/pylib/base/base_test_result.py |
@@ -4,6 +4,8 @@ |
"""Module containing base test results classes.""" |
+from pylib import constants |
+from pylib import exit_code |
class ResultType(object): |
"""Class enumerating test types.""" |
@@ -22,6 +24,7 @@ class ResultType(object): |
class BaseTestResult(object): |
"""Base class for a single test result.""" |
+ |
def __init__(self, name, test_type, log=''): |
"""Construct a BaseTestResult. |
@@ -64,6 +67,7 @@ class BaseTestResult(object): |
class TestRunResults(object): |
"""Set of results for a test run.""" |
+ |
def __init__(self): |
self._results = set() |
@@ -110,6 +114,8 @@ class TestRunResults(object): |
""" |
assert isinstance(result, BaseTestResult) |
self._results.add(result) |
+ if result.GetType() not in [ResultType.PASS, ResultType.UNKNOWN]: |
+ exit_code.UpdateExitCode(constants.ERROR_EXIT_CODE) |
def AddResults(self, results): |
"""Add |results| to the set. |