Commit b990d2a4 authored by Liviu Rau's avatar Liviu Rau Committed by Commit Bot

[testing] Show exit code hex value for failing tests

When a test fails the exit code of the process is printed
in the logs in the decimal format. On Windows searching for
the actual error is pretty difficult in this format since
we are dealing with negative values errors.
We print now the hex format of the same exit value next to
the original one.

Example failure of a test:
https://ci.chromium.org/p/v8/builders/try/v8_win64_dbg/b8897355488287117696
https://logs.chromium.org/logs/v8/buildbucket/cr-buildbucket.appspot.com/8897355488287117696/+/steps/Check/0/stdout
https://logs.chromium.org/logs/v8/buildbucket/cr-buildbucket.appspot.com/8897355488287117696/+/steps/Check/0/logs/RunWasmInterpreter_Int32Const_many/0

Bug: v8:9810
Change-Id: I51b65d6105bda6516707a764dbd41fd36c9dfc80
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1903975
Commit-Queue: Liviu Rau <liviurau@chromium.org>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Reviewed-by: 's avatarTamer Tas <tmrts@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64878}
parent dc1d0796
......@@ -66,6 +66,10 @@ class Output(object):
def IsSuccess(self):
return not self.HasCrashed() and not self.HasTimedOut()
@property
def exit_code_string(self):
return "%d [%02X]" % (self.exit_code, self.exit_code & 0xffffffff)
class _NullOutput(Output):
"""Useful to signal that the binary has not been run."""
......
......@@ -93,7 +93,7 @@ class SimpleProgressIndicator(ProgressIndicator):
print(result.output.stdout.strip())
print("Command: %s" % result.cmd.to_string())
if result.output.HasCrashed():
print("exit code: %d" % result.output.exit_code)
print("exit code: %s" % result.output.exit_code_string)
print("--- CRASHED ---")
crashed += 1
if result.output.HasTimedOut():
......@@ -247,7 +247,7 @@ class CompactProgressIndicator(ProgressIndicator):
print(self._templates['stderr'] % stderr)
print("Command: %s" % result.cmd.to_string(relative=True))
if output.HasCrashed():
print("exit code: %d" % output.exit_code)
print("exit code: %s" % output.exit_code_string)
print("--- CRASHED ---")
if output.HasTimedOut():
print("--- TIMEOUT ---")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment