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

Side by Side Diff: build/android/pylib/base/base_test_result.py

Issue 2251863003: Add tombstones as part of json-results-file for android instr tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor fixes Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | build/android/pylib/instrumentation/test_result.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Module containing base test results classes.""" 5 """Module containing base test results classes."""
6 6
7 import threading 7 import threading
8 8
9 9
10 class ResultType(object): 10 class ResultType(object):
(...skipping 23 matching lines...) Expand all
34 test_type: Type of the test result as defined in ResultType. 34 test_type: Type of the test result as defined in ResultType.
35 duration: Time it took for the test to run in milliseconds. 35 duration: Time it took for the test to run in milliseconds.
36 log: An optional string listing any errors. 36 log: An optional string listing any errors.
37 """ 37 """
38 assert name 38 assert name
39 assert test_type in ResultType.GetTypes() 39 assert test_type in ResultType.GetTypes()
40 self._name = name 40 self._name = name
41 self._test_type = test_type 41 self._test_type = test_type
42 self._duration = duration 42 self._duration = duration
43 self._log = log 43 self._log = log
44 self._tombstones = None
44 45
45 def __str__(self): 46 def __str__(self):
46 return self._name 47 return self._name
47 48
48 def __repr__(self): 49 def __repr__(self):
49 return self._name 50 return self._name
50 51
51 def __cmp__(self, other): 52 def __cmp__(self, other):
52 # pylint: disable=W0212 53 # pylint: disable=W0212
53 return cmp(self._name, other._name) 54 return cmp(self._name, other._name)
(...skipping 27 matching lines...) Expand all
81 return self._duration 82 return self._duration
82 83
83 def SetLog(self, log): 84 def SetLog(self, log):
84 """Set the test log.""" 85 """Set the test log."""
85 self._log = log 86 self._log = log
86 87
87 def GetLog(self): 88 def GetLog(self):
88 """Get the test log.""" 89 """Get the test log."""
89 return self._log 90 return self._log
90 91
92 def SetTombstones(self, tombstones):
93 self._tombstones = tombstones
94
95 def GetTombstones(self):
96 return self._tombstones
91 97
92 class TestRunResults(object): 98 class TestRunResults(object):
93 """Set of results for a test run.""" 99 """Set of results for a test run."""
94 100
95 def __init__(self): 101 def __init__(self):
96 self._results = set() 102 self._results = set()
97 self._results_lock = threading.RLock() 103 self._results_lock = threading.RLock()
98 104
99 def GetLogs(self): 105 def GetLogs(self):
100 """Get the string representation of all test logs.""" 106 """Get the string representation of all test logs."""
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 return self._GetType(ResultType.UNKNOWN) 227 return self._GetType(ResultType.UNKNOWN)
222 228
223 def GetNotPass(self): 229 def GetNotPass(self):
224 """Get the set of all non-passed test results.""" 230 """Get the set of all non-passed test results."""
225 return self.GetAll() - self.GetPass() 231 return self.GetAll() - self.GetPass()
226 232
227 def DidRunPass(self): 233 def DidRunPass(self):
228 """Return whether the test run was successful.""" 234 """Return whether the test run was successful."""
229 return not self.GetNotPass() - self.GetSkip() 235 return not self.GetNotPass() - self.GetSkip()
230 236
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/instrumentation/test_result.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698