Skip to content

Commit

Permalink
[lit] Fix refacto introduced by rL282479.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282501 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
ddunbar committed Sep 27, 2016
1 parent 3ecd753 commit 09e2479
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion utils/lit/lit/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,18 @@ def run_one_tester(run, provider, display):
tester.run()

###

class _Display(object):
def __init__(self, display, provider, maxFailures):
self.display = display
self.provider = provider
self.maxFailures = maxFailures or object()
self.failedCount = 0
def update(self, test):
self.display.update(test)
self.failedCount += (test.result.code == lit.Test.FAIL)
if self.failedCount == self.maxFailures:
provider.cancel()
self.provider.cancel()

def handleFailures(provider, consumer, maxFailures):
consumer.display = _Display(consumer.display, provider, maxFailures)
Expand Down

0 comments on commit 09e2479

Please sign in to comment.