This is an archive of the discontinued LLVM Phabricator instance.

Return a lit.Test.Result object from TestRunner's executeShTest()
ClosedPublic

Authored by dim on May 25 2017, 4:52 PM.

Details

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.

Diff Detail

Repository
rL LLVM

Event Timeline

dim created this revision.May 25 2017, 4:52 PM
rnk edited edge metadata.May 25 2017, 4:54 PM

lgtm

This revision was automatically updated to reflect the committed changes.
MatzeB added a subscriber: MatzeB.May 25 2017, 5:11 PM

Looks like an oversight in r189545. I am surprised this wasn't noticed before.