on master help sign in
Fix error handling, use pipefail

* Also, fix --prefix not working due to missing ";" * Fix correct benchmark name to be printed

commitedbb7b801031fd3b909d43d53baa6bf7386d66b8 authorHarendra Kumar <harendra@composewell.com> dateSun 6 Jun 2021, 19:33 (5 years ago) parentb0fdda4
2 files changed+10−5
bin/bench-exec-one.sh+7−4 bin/bench.sh+3−1
bin/bench-exec-one.sh+7−4
@@ -7,6 +7,9 @@
77# USE_GAUGE: whether to use gauge or tasty-bench
88# LONG: whether to use a large stream size
99
10+set -e
11+set -o pipefail
12+
1013# $1: message
1114die () {
1215 >&2 echo -e "Error: $1"
@@ -183,9 +186,9 @@ then
183186 # XXX this is a hack to make the "/" separated names used in the functions
184187 # determining options based on benchmark name. For tasty-bench the benchmark
185188 # names are separated by "." instead of "/".
186− BENCH_NAME=$(echo $BENCH_NAME_ORIG | sed -e s/^All\.//)
187− BENCH_NAME1=$(echo $BENCH_NAME | cut -f1 -d '/')
188− BENCH_NAME2=$(echo $BENCH_NAME | cut -f2- -d '/' | sed -e 's/\./\//g')
189+ BENCH_NAME0=$(echo $BENCH_NAME_ORIG | sed -e s/^All\.//)
190+ BENCH_NAME1=$(echo $BENCH_NAME0 | cut -f1 -d '/')
191+ BENCH_NAME2=$(echo $BENCH_NAME0 | cut -f2- -d '/' | sed -e 's/\./\//g')
189192 BENCH_NAME="$BENCH_NAME1/$BENCH_NAME2"
190193else
191194 BENCH_NAME=$BENCH_NAME_ORIG
@@ -219,7 +222,7 @@ then
219222 STREAM_SIZE_OPT="--stream-size $STREAM_SIZE"
220223fi
221224
222−echo "$BENCH_NAME: \
225+echo "$BENCH_NAME_ORIG: \
223226$RTS_OPTIONS \
224227$STREAM_LEN \
225228$QUICK_BENCH_OPTIONS" \
bin/bench.sh+3−1
@@ -1,5 +1,7 @@
11#!/usr/bin/env bash
22
3+set -o pipefail
4+
35SCRIPT_DIR=$(cd `dirname $0`; pwd)
46
57RUNNING_BENCHMARKS=y
@@ -333,7 +335,7 @@ do
333335 # options with arguments
334336 --benchmarks) shift; TARGETS=$1; shift ;;
335337 --targets) shift; TARGETS=$1; shift ;;
336− --prefix) shift; BENCH_PREFIX="$1" shift ;;
338+ --prefix) shift; BENCH_PREFIX="$1"; shift ;;
337339 --fields) shift; FIELDS=$1; shift ;;
338340 --base) shift; BASE=$1; shift ;;
339341 --candidate) shift; CANDIDATE=$1; shift ;;