]> Nishi Git Mirror - gwion.git/commitdiff
:shirt: Shellcheck 108/head
authorfennecdjay <astor.jeremie@wanadoo.fr>
Mon, 11 Mar 2019 09:46:20 +0000 (10:46 +0100)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Mon, 11 Mar 2019 09:46:20 +0000 (10:46 +0100)
help/benchmark.sh
help/test.sh

index 61ced6ac28d601de2121a93c2346f552b01766cd..f747f0e85ba20f5d7792a03e59e614fa4b18212f 100644 (file)
@@ -1,13 +1,12 @@
-#!/bin/zsh
+#!/bin/sh
 #run benchmarks and make plots
 n=0
-function fib_test() {
-  echo $n $1 $(perf stat -r10 $1 fib_recurs.$2 2>&1 | grep "time elapsed" | cut -d s -f 1 | sed 's/+-//' | sed 's/,/./g')
+fib_test() {
+  echo $n "$1" "$(perf stat -r10 "$1" "fib_recurs.$2" 2>&1 | grep "time elapsed" | cut -d s -f 1 | sed 's/+-//' | sed 's/,/./g')"
   n=$((n+1))
 }
 
-GWION_DIR=$PWD
-cd ~/fib_recurs/
+cd ~/fib_recurs/ || exit 1
 
 fib_test gwion gw
 fib_test lua   lua
index cd2f867b7cb48f013a4d7633013e4c068282ce50..0975493cb5008a38f56aed408c92c7962a98404f 100644 (file)
@@ -132,7 +132,7 @@ fail() {
     info=$(cat "$log")
     echo "not ok $(printf "% 4i" "$n") $desc" > "$log"
     echo "# $info" >> "$log"
-    echo "$desc $(cat $4)" >> "test.log"
+    echo "$desc $(cat "$4")" >> "test.log"
   fi
   return 1
 }