X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fbugs%2Fsignals.sh;h=20ca0700947e96a3201520ba2eda95e58f9374cf;hb=5933892c21c6166b5714be979116d3aa70219c57;hp=a08aa9a574a73ee01b4f8d651d29a8ace49c2ea0;hpb=2bad4e1d02bd2d33de548ec8cf145999700a1aa4;p=pspp diff --git a/tests/bugs/signals.sh b/tests/bugs/signals.sh index a08aa9a574..20ca070094 100755 --- a/tests/bugs/signals.sh +++ b/tests/bugs/signals.sh @@ -11,7 +11,7 @@ if [ -z "$top_builddir" ] ; then top_builddir=. ; fi top_srcdir=`cd $top_srcdir; pwd` top_builddir=`cd $top_builddir; pwd` -PSPP=$top_builddir/src/ui/terminal/pspp +PSPP=$top_builddir/src/ui/terminal/pspp$EXEEXT STAT_CONFIG_PATH=$top_srcdir/config export STAT_CONFIG_PATH @@ -26,10 +26,8 @@ cleanup() echo "NOT cleaning $TEMPDIR" return ; fi + cd / rm -rf $TEMPDIR - - # Kill any remaining children of this shell - kill `ps h --ppid $$ | awk '{print $1}'` 2> /dev/null } @@ -60,41 +58,20 @@ mkdir -p $TEMPDIR cd $TEMPDIR - -activity="run program in interactive mode" -cat | $PSPP --testing-mode -o raw-ascii 2> $TEMPDIR/stderr1 > /dev/null & -thepid1=$! -if [ $? -ne 0 ] ; then no_result ; fi - -activity="run program in interactive mode 2" -cat | $PSPP --testing-mode -o raw-ascii 2> $TEMPDIR/stderr2 > /dev/null & -thepid2=$! -if [ $? -ne 0 ] ; then no_result ; fi - -# This one is a dummy. Despite the sleep command, it may not be enought -# to ensure that the preceeding pspp has actually initialised itself. -activity="run program in interactive mode 3" -cat | $PSPP --testing-mode -o raw-ascii 2> /dev/null > /dev/null & sleep 1 -thepid3=$! -if [ $? -ne 0 ] ; then no_result ; fi - -activity="sending SIGINT to pspp1" -kill -INT $thepid1 -if [ $? -ne 0 ] ; then no_result ; fi - -activity="sending SIGSEGV to pspp2" -kill -SEGV $thepid2 +activity="sending SIGINT to pspp" +echo 'host command=["kill -INT $PPID"].' | $PSPP -o pspp.csv > /dev/null 2> $TEMPDIR/stderr1 if [ $? -ne 0 ] ; then no_result ; fi - # SIGINT should have caused a clean shutdown - activity="checking for absence of error messages 1" [ ! -s $TEMPDIR/stderr1 ] if [ $? -ne 0 ] ; then fail ; fi -# SIGSEGV should have caused an error message +activity="sending SIGSEGV to pspp" +echo 'host command=["kill -SEGV $PPID"].' | $PSPP -o pspp.csv > /dev/null 2> $TEMPDIR/stderr2 +if [ $? -eq 0 ] ; then no_result ; fi +# SIGSEGV should have caused an error message activity="checking for error messages from pspp 2" head -8 $TEMPDIR/stderr2 > $TEMPDIR/stderr-head if [ $? -ne 0 ] ; then no_result ; fi