Use gtimeout if it exists.
@@ -13,6 +13,12 @@ if test -x /bin/echo;then
ECHO=/bin/echo
fi
+if type gtimeout >/dev/null 2>&1;then
+ TIMEOUT=gtimeout
+else
+ TIMEOUT=timeout
+fi
+
runtest () {
t=$1
add_main=$2
@@ -22,7 +28,7 @@ runtest () {
another_expect=`dirname $t`/`basename $t .c`.expect
if test x$expect_out = x && test -f $another_expect; then expect_out=$another_expect; else expect_out=; fi
$ECHO -n $t:
- timeout 30s $execution_program $t $add_main 2>$errf >$outf
+ $TIMEOUT 30s $execution_program $t $add_main 2>$errf >$outf
code=$?
if test $code = $expect_code; then
if test x$expect_out != x && ! cmp $outf $expect_out;then
