]>
git.proxmox.com Git - rustc.git/blob - src/llvm/utils/lit/lit/LitTestCase.py
1 from __future__
import absolute_import
7 TestCase adaptor for providing a 'unittest' compatible interface to 'lit' tests.
10 class UnresolvedError(RuntimeError):
13 class LitTestCase(unittest
.TestCase
):
14 def __init__(self
, test
, run
):
15 unittest
.TestCase
.__init
__(self
)
20 return self
._test
.getFullName()
22 def shortDescription(self
):
23 return self
._test
.getFullName()
27 self
._run
.execute_test(self
._test
)
29 # Adapt the result to unittest.
30 result
= self
._test
.result
31 if result
.code
is lit
.Test
.UNRESOLVED
:
32 raise UnresolvedError(result
.output
)
33 elif result
.code
.isFailure
:
34 self
.fail(result
.output
)