Skip to content

Commit

Permalink
[lit] Update LitTestCase to support lit.Test.Result.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189544 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
ddunbar committed Aug 29, 2013
1 parent e54726a commit 8a1d9b2
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions utils/lit/lit/LitTestCase.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,18 @@ def shortDescription(self):
return self._test.getFullName()

def runTest(self):
tr, output = self._test.config.test_format.execute(
result = self._test.config.test_format.execute(
self._test, self._lit_config)

if tr is lit.Test.UNRESOLVED:
raise UnresolvedError(output)
elif tr.isFailure:
self.fail(output)
# Support deprecated result from execute() which returned the result
# code and additional output as a tuple.
if isinstance(result, tuple):
code, output = result
result = lit.Test.Result(code, output)
elif not isinstance(result, lit.Test.Result):
raise ValueError("unexpected result from test execution")

if result.code is lit.Test.UNRESOLVED:
raise UnresolvedError(result.output)
elif result.code.isFailure:
self.fail(result.output)

0 comments on commit 8a1d9b2

Please sign in to comment.