Commit 95fd0f8d664bea546b9c063b886a0cee96a50955

Steffen Jaeckel 2017-08-29T17:12:36

handle non-existing 'timeout' on MacOS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/testme.sh b/testme.sh
index a65e2f8..ee2e87c 100755
--- a/testme.sh
+++ b/testme.sh
@@ -78,7 +78,9 @@ _runtest()
     exit 128
   fi
   echo -e "\rRun test $1 $2"
-  timeout --foreground 90 ./test > test_${suffix}.txt || _die "running tests" $?
+  local _timeout=""
+  which timeout >/dev/null && _timeout="timeout --foreground 90"
+  $_timeout ./test > test_${suffix}.txt || _die "running tests" $?
 }
 
 _banner()