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

Side by Side Diff: expect_tests/type_definitions.py

Issue 731723002: Don't return failure if no tests. (Closed) Base URL: https://chromium.googlesource.com/infra/testing/expect_tests@master
Patch Set: Created 6 years, 1 month 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 from contextlib import contextmanager 5 from contextlib import contextmanager
6 import copy 6 import copy
7 import inspect 7 import inspect
8 import os 8 import os
9 import re 9 import re
10 10
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 flexible interface for dealing with |objects|. 473 flexible interface for dealing with |objects|.
474 474
475 @param opts: Parsed CLI options 475 @param opts: Parsed CLI options
476 @param objects: Iteraterable of objects from GenStage and RunStage. 476 @param objects: Iteraterable of objects from GenStage and RunStage.
477 """ 477 """
478 error = False 478 error = False
479 aborted = False 479 aborted = False
480 handler = cls.ResultStageHandler(opts) 480 handler = cls.ResultStageHandler(opts)
481 try: 481 try:
482 for obj in objects: 482 for obj in objects:
483 error |= isinstance(handler(obj), Failure) 483 error |= (isinstance(handler(obj), Failure) and not
484 isinstance(obj, NoMatchingTestsError))
ghost stip (do not use) 2014/11/15 01:32:27 note that this is obj, and not handler(obj)
iannucci 2014/11/15 01:34:19 shouldn't this check come before we run handler on
ghost stip (do not use) 2014/11/15 01:38:12 Acknowledged.
484 except ResultStageAbort: 485 except ResultStageAbort:
485 aborted = True 486 aborted = True
486 handler.finalize(aborted) 487 handler.finalize(aborted)
487 return error 488 return error
488 489
489 class ResultStageHandler(object): 490 class ResultStageHandler(object):
490 """SAX-like event handler dispatches to self.handle_{type(obj).__name__} 491 """SAX-like event handler dispatches to self.handle_{type(obj).__name__}
491 492
492 So if |obj| is a Test, this would call self.handle_Test(obj). 493 So if |obj| is a Test, this would call self.handle_Test(obj).
493 494
(...skipping 24 matching lines...) Expand all
518 print 'UNHANDLED:', obj 519 print 'UNHANDLED:', obj
519 return Failure() 520 return Failure()
520 521
521 def finalize(self, aborted): 522 def finalize(self, aborted):
522 """Called after __call__() has been called for all results. 523 """Called after __call__() has been called for all results.
523 524
524 @param aborted: True if the user aborted the run. 525 @param aborted: True if the user aborted the run.
525 @type aborted: bool 526 @type aborted: bool
526 """ 527 """
527 pass 528 pass
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698