Make gn_run_binary.py print out the exit code on error.
Review-Url: https://codereview.chromium.org/2820753004
Cr-Commit-Position: refs/heads/master@{#464890}
diff --git a/build/gn_run_binary.py b/build/gn_run_binary.py
index 7d83f61..130c843 100644
--- a/build/gn_run_binary.py
+++ b/build/gn_run_binary.py
@@ -8,8 +8,8 @@
python gn_run_binary.py <binary_name> [args ...]
"""
-import sys
import subprocess
+import sys
# This script is designed to run binaries produced by the current build. We
# always prefix it with "./" to avoid picking up system versions that might
@@ -19,4 +19,7 @@
# The rest of the arguements are passed directly to the executable.
args = [path] + sys.argv[2:]
-sys.exit(subprocess.call(args))
+ret = subprocess.call(args)
+if ret != 0:
+ print '%s failed with exit code %d' % (sys.argv[1], ret)
+sys.exit(ret)