on master help sign in
Check for GNU awk
commit3feeec2e8efdeaa152d1bfeb91565f2d9644deb1 authorHarendra Kumar <harendra@composewell.com> dateTue 8 Jun 2021, 15:05 (5 years ago) parentcc198c5
2 files changed+6−2
bin/bench-exec-one.sh+2 bin/bench.sh+4−2
bin/bench-exec-one.sh+2
@@ -252,6 +252,8 @@ then
252252 -p '$0 == "'"$BENCH_NAME_ESC"'"'
253253
254254 # Convert cpuTime field from picoseconds to seconds
255+ awk --version 2>&1 | grep -q "GNU Awk" \
256+ || die "Need GNU awk. [$(which awk)] is not GNU awk."
255257 tail -n +2 ${output_file}.tmp | \
256258 awk 'BEGIN {FPAT = "([^,]+)|(\"[^\"]+\")";OFS=","} {$2=$2/1000000000000;print}' \
257259 >> $output_file
bin/bench.sh+4−2
@@ -164,7 +164,8 @@ invoke_gauge () {
164164 $target_prog -l \
165165 | grep "^$MATCH" \
166166 | while read -r name; \
167− do bin/bench-exec-one.sh "$name" "${GAUGE_ARGS[@]}"; done
167+ do bin/bench-exec-one.sh "$name" "${GAUGE_ARGS[@]}" || exit 1; done \
168+ || die "Benchmark execution failed."
168169}
169170
170171invoke_tasty_bench () {
@@ -188,7 +189,8 @@ invoke_tasty_bench () {
188189 $target_prog -l $MATCH \
189190 | grep "^All" \
190191 | while read -r name; \
191− do bin/bench-exec-one.sh "$name" "${GAUGE_ARGS[@]}"; done
192+ do bin/bench-exec-one.sh "$name" "${GAUGE_ARGS[@]}" || exit 1; done \
193+ || die "Benchmark execution failed."
192194}
193195
194196run_bench_target () {