From: David Given Date: Thu, 17 Nov 2016 21:04:50 +0000 (+0100) Subject: Betterer timeout handling. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=a4616b71241060d1e6c0c59e0a05b27f762f0d32;p=ack.git Betterer timeout handling. --- diff --git a/plat/qemuppc/tests/testdriver.sh b/plat/qemuppc/tests/testdriver.sh index 8cce48d1c..3424e9626 100755 --- a/plat/qemuppc/tests/testdriver.sh +++ b/plat/qemuppc/tests/testdriver.sh @@ -13,8 +13,10 @@ trap "rm -f $result" EXIT pidfile=/tmp/$$.testdriver.pid trap "rm -f $pidfile" EXIT -($qemu -nographic -kernel $img 2>&1 & echo $! > $pidfile ) | tee $result | \ - grep -l @@FINISHED | (read dummy && kill $(cat $pidfile)) +( $qemu -nographic -kernel $img 2>&1 & echo $! > $pidfile ) \ + | tee $result \ + | ( timeout $timeout grep -l -q @@FINISHED ; echo ) \ + | ( read dummy && kill $(cat $pidfile) ) -grep @@FAIL $result && cat $result && exit 1 +( grep -q @@FAIL $result || ! grep -q @@FINISHED $result ) && cat $result && exit 1 exit 0 \ No newline at end of file