From 1d8fb411ba9d4df4abb98936937ffd44f9fce3b0 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Mon, 22 Nov 2021 13:12:57 +1100 Subject: [PATCH] Let bench-history.sh handle compile/bench failures --- script/bench-history.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/script/bench-history.sh b/script/bench-history.sh index 689550e9..bc583024 100755 --- a/script/bench-history.sh +++ b/script/bench-history.sh @@ -32,9 +32,19 @@ save=`git log -1 --pretty=format:"%H"` i=0 while [ $i -lt $num_commits ]; do - this_hash=`git log -1 --pretty=format:"%h"` + set +e $cc -O3 -o bench-history.out test/c/std/$package.c - this_metric=`./bench-history.out -bench -focus=$focus -iterscale=$iterscale -reps=$reps | benchstat /dev/stdin | sed -ne '/^name.*speed$/,$ p' | grep $focus` + if [ $? -ne 0 ]; then + this_metric='compile_failed' + else + this_metric=`./bench-history.out -bench -focus=$focus -iterscale=$iterscale -reps=$reps | benchstat /dev/stdin | sed -ne '/^name.*speed$/,$ p' | grep $focus` + if [ $? -ne 0 ]; then + this_metric='bench_failed' + fi + fi + set -e + + this_hash=`git log -1 --pretty=format:"%h"` echo $this_hash $this_metric git checkout --quiet HEAD^ i=$((i + 1))