on master help sign in
Check for GNU awk
3feeec2Harendra Kumar
bin/bench-exec-one.sh+2
@@ -252,6 +252,8 @@ then
252 -p '$0 == "'"$BENCH_NAME_ESC"'"'
252 -p '$0 == "'"$BENCH_NAME_ESC"'"'
253
253
254 # Convert cpuTime field from picoseconds to seconds
254 # 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."
255 tail -n +2 ${output_file}.tmp | \
257 tail -n +2 ${output_file}.tmp | \
256 awk 'BEGIN {FPAT = "([^,]+)|(\"[^\"]+\")";OFS=","} {$2=$2/1000000000000;print}' \
258 awk 'BEGIN {FPAT = "([^,]+)|(\"[^\"]+\")";OFS=","} {$2=$2/1000000000000;print}' \
257 >> $output_file
259 >> $output_file
bin/bench.sh+4−2
@@ -164,7 +164,8 @@ invoke_gauge () {
164 $target_prog -l \
164 $target_prog -l \
165 | grep "^$MATCH" \
165 | grep "^$MATCH" \
166 | while read -r name; \
166 | 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."
168}
169}
169
170
170invoke_tasty_bench () {
171invoke_tasty_bench () {
@@ -188,7 +189,8 @@ invoke_tasty_bench () {
188 $target_prog -l $MATCH \
189 $target_prog -l $MATCH \
189 | grep "^All" \
190 | grep "^All" \
190 | while read -r name; \
191 | 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."
192}
194}
193
195
194run_bench_target () {
196run_bench_target () {