[llvm] r189544 - [lit] Update LitTestCase to support lit.Test.Result.
Daniel Dunbar
daniel at zuster.org
Wed Aug 28 17:40:59 PDT 2013
Author: ddunbar
Date: Wed Aug 28 19:40:59 2013
New Revision: 189544
URL: http://llvm.org/viewvc/llvm-project?rev=189544&view=rev
Log:
[lit] Update LitTestCase to support lit.Test.Result.
Modified:
llvm/trunk/utils/lit/lit/LitTestCase.py
Modified: llvm/trunk/utils/lit/lit/LitTestCase.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/LitTestCase.py?rev=189544&r1=189543&r2=189544&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/LitTestCase.py (original)
+++ llvm/trunk/utils/lit/lit/LitTestCase.py Wed Aug 28 19:40:59 2013
@@ -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)
More information about the llvm-commits
mailing list