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

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

Issue 13081002: [Android] Do not list tests wihtout logs in 'Detailed Logs' section. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | build/android/pylib/base/base_test_result_unittest.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 7
8 class ResultType(object): 8 class ResultType(object):
9 """Class enumerating test types.""" 9 """Class enumerating test types."""
10 PASS = 'PASS' 10 PASS = 'PASS'
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 """Set of results for a test run.""" 66 """Set of results for a test run."""
67 def __init__(self): 67 def __init__(self):
68 self._results = set() 68 self._results = set()
69 69
70 def GetLogs(self): 70 def GetLogs(self):
71 """Get the string representation of all test logs.""" 71 """Get the string representation of all test logs."""
72 s = [] 72 s = []
73 for test_type in ResultType.GetTypes(): 73 for test_type in ResultType.GetTypes():
74 if test_type != ResultType.PASS: 74 if test_type != ResultType.PASS:
75 for t in sorted(self._GetType(test_type)): 75 for t in sorted(self._GetType(test_type)):
76 s.append('[%s] %s:' % (test_type, t)) 76 log = t.GetLog()
77 s.append(t.GetLog()) 77 if log:
78 s.append('[%s] %s:' % (test_type, t))
79 s.append(log)
78 return '\n'.join(s) 80 return '\n'.join(s)
79 81
80 def GetLongForm(self): 82 def GetLongForm(self):
81 """Get the long string representation of this object.""" 83 """Get the long string representation of this object."""
82 s = [] 84 s = []
83 s.append('ALL (%d tests)' % len(self._results)) 85 s.append('ALL (%d tests)' % len(self._results))
84 for test_type in ResultType.GetTypes(): 86 for test_type in ResultType.GetTypes():
85 tests = sorted(self._GetType(test_type)) 87 tests = sorted(self._GetType(test_type))
86 if test_type == ResultType.PASS: 88 if test_type == ResultType.PASS:
87 s.append('%s (%d tests)' % (test_type, len(tests))) 89 s.append('%s (%d tests)' % (test_type, len(tests)))
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 """Get the set of all unknown test results.""" 158 """Get the set of all unknown test results."""
157 return self._GetType(ResultType.UNKNOWN) 159 return self._GetType(ResultType.UNKNOWN)
158 160
159 def GetNotPass(self): 161 def GetNotPass(self):
160 """Get the set of all non-passed test results.""" 162 """Get the set of all non-passed test results."""
161 return self.GetAll() - self.GetPass() 163 return self.GetAll() - self.GetPass()
162 164
163 def DidRunPass(self): 165 def DidRunPass(self):
164 """Return whether the test run was successful.""" 166 """Return whether the test run was successful."""
165 return not self.GetNotPass() 167 return not self.GetNotPass()
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/base/base_test_result_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698