[LIT] Emit timeout error message only if timeout was reached

Summary:
This improves readability of LIT output: previously
error messages gets emitted that say that there was no error:

error: command reached timeout: False

Patch by Alexey Sachkov.

Reviewers: ddunbar, mgorny, modocache

Reviewed By: mgorny

Subscribers: delcypher, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D64240

llvm-svn: 365895
This commit is contained in:
Alexey Bader 2019-07-12 12:48:43 +00:00
parent 85b7b16172
commit 125995b2cd

View File

@ -1119,7 +1119,7 @@ def executeScriptInternal(test, litConfig, tmpBase, commands, cwd):
codeStr = str(result.exitCode)
out += "error: command failed with exit status: %s\n" % (
codeStr,)
if litConfig.maxIndividualTestTime > 0:
if litConfig.maxIndividualTestTime > 0 and result.timeoutReached:
out += 'error: command reached timeout: %s\n' % (
str(result.timeoutReached),)