diff options
author | Daniel Dunbar <daniel@zuster.org> | 2013-08-29 00:40:59 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2013-08-29 00:40:59 +0000 |
commit | 8a1d9b207a2bec95dfdc72700f8edafd44c98c17 (patch) | |
tree | 1b8a32007965cd817a7be71b82718a786172e9fc /utils/lit | |
parent | e54726a87a49e3254696b05787f4635dc59fe750 (diff) | |
download | external_llvm-8a1d9b207a2bec95dfdc72700f8edafd44c98c17.zip external_llvm-8a1d9b207a2bec95dfdc72700f8edafd44c98c17.tar.gz external_llvm-8a1d9b207a2bec95dfdc72700f8edafd44c98c17.tar.bz2 |
[lit] Update LitTestCase to support lit.Test.Result.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189544 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/lit')
-rw-r--r-- | utils/lit/lit/LitTestCase.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/utils/lit/lit/LitTestCase.py b/utils/lit/lit/LitTestCase.py index 478dbae..ba91fa0 100644 --- a/utils/lit/lit/LitTestCase.py +++ b/utils/lit/lit/LitTestCase.py @@ -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) |