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

Unified Diff: build/android/pylib/base/base_test_result.py

Issue 18323020: Updates the test runner script exit codes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 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 | build/android/pylib/base/shard.py » ('j') | build/android/pylib/base/shard.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2b9347e1e5b05f184a5a326904b1eaa0bcacb4d0 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
+
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,8 +67,10 @@ class BaseTestResult(object):
class TestRunResults(object):
"""Set of results for a test run."""
+
def __init__(self):
self._results = set()
+ self.exit_code = 0
def GetLogs(self):
"""Get the string representation of all test logs."""
@@ -110,6 +115,8 @@ class TestRunResults(object):
"""
assert isinstance(result, BaseTestResult)
self._results.add(result)
+ if result.GetType() not in [ResultType.PASS, ResultType.UNKNOWN]:
+ self.exit_code = constants.ERROR_EXIT_CODE
def AddResults(self, results):
"""Add |results| to the set.
@@ -129,6 +136,7 @@ class TestRunResults(object):
assert isinstance(results, TestRunResults)
# pylint: disable=W0212
self._results.update(results._results)
+ self.exit_code = self.exit_code or results.exit_code
def GetAll(self):
"""Get the set of all test results."""
« no previous file with comments | « no previous file | build/android/pylib/base/shard.py » ('j') | build/android/pylib/base/shard.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698