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

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

Issue 18770008: [Android] Redesigns the sharder to allow replicated vs distributed tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-adds -f short form to gtest_filter switch Created 7 years, 5 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') | no next file with comments »
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 ebf9e71ef01b063d033ac1d693e8cf92ffe4465d..5228200ffae176b68eeb86a24168d25210fefa86 100644
--- a/build/android/pylib/base/base_test_result.py
+++ b/build/android/pylib/base/base_test_result.py
@@ -22,7 +22,7 @@ class ResultType(object):
class BaseTestResult(object):
"""Base class for a single test result."""
- def __init__(self, name, test_type, log=''):
+ def __init__(self, name, test_type, tag='', log=''):
"""Construct a BaseTestResult.
Args:
@@ -34,20 +34,28 @@ class BaseTestResult(object):
assert test_type in ResultType.GetTypes()
self._name = name
self._test_type = test_type
+ self._tag = tag
self._log = log
def __str__(self):
- return self._name
+ return self.GetTaggedName()
def __repr__(self):
- return self._name
+ return self.GetTaggedName()
def __cmp__(self, other):
# pylint: disable=W0212
- return cmp(self._name, other._name)
+ return cmp(self.GetTaggedName(), other.GetTaggedName())
def __hash__(self):
- return hash(self._name)
+ return hash(self.GetTaggedName())
+
+ def GetTaggedName(self):
+ """Get the test name with tag."""
+ if self._tag:
+ return '%s_%s' % (self._tag, self._name)
+ else:
+ return self._name
def GetName(self):
"""Get the test name."""
@@ -57,10 +65,18 @@ class BaseTestResult(object):
"""Get the test result type."""
return self._test_type
+ def GetTag(self):
+ """Get the test tag."""
+ return self._tag
+
def GetLog(self):
"""Get the test log."""
return self._log
+ def SetTag(self, tag):
+ """Set the test tag."""
+ self._tag = tag
+
class TestRunResults(object):
"""Set of results for a test run."""
« no previous file with comments | « no previous file | build/android/pylib/base/shard.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698