mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-29 22:30:33 +00:00
[lit] Update LitTestCase to support lit.Test.Result.
llvm-svn: 189544
This commit is contained in:
parent
e9ab6cbf97
commit
24e675afd3
@ -23,10 +23,18 @@ class LitTestCase(unittest.TestCase):
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user