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

Side by Side Diff: scripts/slave/unittests/expect_tests/type_definitions.py

Issue 240053005: Various minor improvements to recipe_simulation_test.py. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 6 years, 8 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
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 import os 5 import os
6 6
7 from collections import namedtuple 7 from collections import namedtuple
8 8
9 UnknownError = namedtuple('UnknownError', 'message') 9 UnknownError = namedtuple('UnknownError', 'message')
10 TestError = namedtuple('TestError', 'test message') 10 TestError = namedtuple('TestError', 'test message')
11 NoMatchingTestsError = namedtuple('NoMatchingTestsError', '')
11 Result = namedtuple('Result', 'data') 12 Result = namedtuple('Result', 'data')
12 13
13 class ResultStageAbort(Exception): 14 class ResultStageAbort(Exception):
14 pass 15 pass
15 16
16 17
17 class Failure(object): 18 class Failure(object):
18 pass 19 pass
19 20
20 21
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 def __call__(self, obj): 163 def __call__(self, obj):
163 """Called to handle each object in the ResultStage 164 """Called to handle each object in the ResultStage
164 165
165 @type obj: Anything passed to put_result in GenStage or RunStage. 166 @type obj: Anything passed to put_result in GenStage or RunStage.
166 167
167 @return: If the handler method returns Failure(), then it will 168 @return: If the handler method returns Failure(), then it will
168 cause the entire test run to ultimately return an error code. 169 cause the entire test run to ultimately return an error code.
169 """ 170 """
170 return getattr(self, 'handle_' + type(obj).__name__, self.__unknown)(obj) 171 return getattr(self, 'handle_' + type(obj).__name__, self.__unknown)(obj)
171 172
173 def handle_NoMatchingTestsError(self, _error):
174 print 'No tests found that match the glob: %s' % (
175 ' '.join(self.opts.test_glob),)
176 return Failure()
177
172 def __unknown(self, obj): 178 def __unknown(self, obj):
173 if self.opts.verbose: 179 if self.opts.verbose:
174 print 'UNHANDLED:', obj 180 print 'UNHANDLED:', obj
175 return Failure() 181 return Failure()
176 182
177 def finalize(self, aborted): 183 def finalize(self, aborted):
178 """Called after __call__() has been called for all results. 184 """Called after __call__() has been called for all results.
179 185
180 @param aborted: True if the user aborted the run. 186 @param aborted: True if the user aborted the run.
181 @type aborted: bool 187 @type aborted: bool
182 """ 188 """
183 pass 189 pass
OLDNEW
« no previous file with comments | « scripts/slave/unittests/expect_tests/pipeline.py ('k') | scripts/slave/unittests/recipe_simulation_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698