ack/plat/qemuppc/tests/testdriver.sh
2016-11-13 13:37:22 +01:00

28 lines
393 B
Bash
Executable file

#!/bin/sh
qemu=$1
img=$2
timeout=$3
pipe=/tmp/testdriver.$$.pipe
mknod $pipe p
trap "rm $pipe" EXIT
timeout $timeout $qemu -nographic -kernel $img >$pipe 2>&1 &
pid=$!
status=0
while read line < $pipe; do
case "$line" in
*@@FAIL*)
echo $line
status=1
;;
*@@FINISHED*)
kill $pid
;;
esac
done
exit $status