summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2016-11-07 21:06:20 +0000
committerReid Kleckner <rnk@google.com>2016-11-07 21:06:20 +0000
commit891bb4872c8098f8a851a92e989af3252b46f5ad (patch)
tree24166044799d36bdaf825009e82121c01bc48037
parent5d387286d00c2d4b46510dcb9b76b9a5c80d5a02 (diff)
downloadbcm5719-llvm-891bb4872c8098f8a851a92e989af3252b46f5ad.tar.gz
bcm5719-llvm-891bb4872c8098f8a851a92e989af3252b46f5ad.zip
[lit] Print negative exit codes on Windows in hex
Negative exit codes are usually exceptions. They're easier to recognize in hex. Compare -1073741502 to 0xc0000142. llvm-svn: 286150
-rw-r--r--llvm/utils/lit/lit/TestRunner.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index b242f8fb021..8e780a2f971 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -555,8 +555,14 @@ def executeScriptInternal(test, litConfig, tmpBase, commands, cwd):
# Show the error conditions:
if result.exitCode != 0:
- out += "error: command failed with exit status: %d\n" % (
- result.exitCode,)
+ # On Windows, a negative exit code indicates a signal, and those are
+ # easier to recognize or look up if we print them in hex.
+ if litConfig.isWindows and result.exitCode < 0:
+ codeStr = hex(int(result.exitCode & 0xFFFFFFFF)).rstrip("L")
+ else:
+ codeStr = str(result.exitCode)
+ out += "error: command failed with exit status: %s\n" % (
+ codeStr,)
if litConfig.maxIndividualTestTime > 0:
out += 'error: command reached timeout: %s\n' % (
str(result.timeoutReached),)
OpenPOWER on IntegriCloud