[llvm] r303943 - Return a lit.Test.Result object from TestRunner's executeShTest()
Dimitry Andric via llvm-commits
llvm-commits at lists.llvm.org
Thu May 25 16:56:44 PDT 2017
Author: dim
Date: Thu May 25 18:56:44 2017
New Revision: 303943
URL: http://llvm.org/viewvc/llvm-project?rev=303943&view=rev
Log:
Return a lit.Test.Result object from TestRunner's executeShTest()
Summary:
For various clang analyzer tests, which were unsupported, I got lit
exceptions, similar to the following:
Exception during script execution:
Traceback (most recent call last):
File "utils/lit/lit/run.py", line 190, in execute_test
result = test.config.test_format.execute(test, lit_config)
File "tools/clang/test/Analysis/analyzer_test.py", line 11, in execute
if result.code == lit.Test.FAIL:
AttributeError: 'tuple' object has no attribute 'code'
This is because executeShTest() in utils/lit/lit/TestRunner.py is
supposed to return a lit.Test.Result object, but in case of unsupported
tests, it returns a plain tuple.
Fix this by returning a properly initialized lit.Test.Result object
instead.
Reviewers: rnk, rafael, modocache
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D33579
Modified:
llvm/trunk/utils/lit/lit/TestRunner.py
Modified: llvm/trunk/utils/lit/lit/TestRunner.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestRunner.py?rev=303943&r1=303942&r2=303943&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/TestRunner.py (original)
+++ llvm/trunk/utils/lit/lit/TestRunner.py Thu May 25 18:56:44 2017
@@ -1056,7 +1056,7 @@ def _runShTest(test, litConfig, useExter
def executeShTest(test, litConfig, useExternalSh,
extra_substitutions=[]):
if test.config.unsupported:
- return (Test.UNSUPPORTED, 'Test is unsupported')
+ return lit.Test.Result(Test.UNSUPPORTED, 'Test is unsupported')
script = parseIntegratedTestScript(test)
if isinstance(script, lit.Test.Result):
More information about the llvm-commits
mailing list