#!../../bash
# -*- shell-script -*-

[ -z "$builddir" ] && export builddir=$PWD
[ -z "$top_builddir" ] && export top_builddir=$builddir/../..

CHECK_FILE=interrupt.check
started_markerfile=$top_builddir/test/interrupt.tst
if [[ -f $started_markerfile ]] ; then
    rm -f $started_markerfile || exit 77
fi

$SH ${top_builddir}/test/example/interrupt.sh $started_markerfile > $CHECK_FILE & 
while [[ ! -f $started_markerfile ]] ; do
    sleep 1
done

kill -TERM %1
while [[ ! -s $CHECK_FILE ]] ; do
  sleep 1
done
rm -f $started_markerfile
