track_memory.sh should fail if its subcommand fails
Golem is running the script run_bootstrap_benchmark.py, which uses track_memory.sh. Therefore, prior to this CL, Golem would report that a CL that introduces an uncaught exception actually improves the code size by 100 %.
Change-Id: If3af215c1d54082b35f0ea8e6e7aac1207f5ce26
diff --git a/tools/track_memory.sh b/tools/track_memory.sh
index c0b4716..4629d4b 100755
--- a/tools/track_memory.sh
+++ b/tools/track_memory.sh
@@ -16,7 +16,7 @@
function Exit {
kill $lid
- exit 0
+ exit $code
}
function Kill {
@@ -41,3 +41,4 @@
trap "Exit" EXIT
trap "Kill" SIGINT
wait $pid
+code=$?