[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: new failing test
From: |
John Darrington |
Subject: |
Re: new failing test |
Date: |
Wed, 22 Nov 2006 14:55:07 +0800 |
User-agent: |
Mutt/1.5.9i |
On Tue, Nov 21, 2006 at 10:17:02PM -0800, Ben Pfaff wrote:
Here's my proposal for a fix:
If it works, this is a good idea. I never thought of using the HOST
command to do this.
J'
--- signals.sh.~1.1.~ 2006-11-14 04:29:26.000000000 -0800
+++ signals.sh 2006-11-21 22:14:44.000000000 -0800
@@ -27,9 +27,6 @@ cleanup()
return ;
fi
rm -rf $TEMPDIR
-
- # Kill any remaining children of this shell
- kill `ps h --ppid $$ | awk '{print $1}'` 2> /dev/null
}
@@ -60,41 +57,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 kill -INT $PPID' | $PSPP --testing-mode -o raw-ascii >
/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 kill -SEGV $PPID' | $PSPP --testing-mode -o raw-ascii >
/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
It requires a fix to the HOST command's implementation:
--- command.def.~1.9.~ 2006-10-29 12:24:11.000000000 -0800
+++ command.def 2006-11-21 22:09:55.000000000 -0800
@@ -26,7 +26,7 @@ DEF_CMD (S_ANY, 0, "EXIT", cmd_finish)
DEF_CMD (S_ANY, 0, "FILE HANDLE", cmd_file_handle)
DEF_CMD (S_ANY, F_KEEP_FINAL_TOKEN, "FILE LABEL", cmd_file_label)
DEF_CMD (S_ANY, 0, "FINISH", cmd_finish)
-DEF_CMD (S_ANY, 0, "HOST", cmd_host)
+DEF_CMD (S_ANY, F_KEEP_FINAL_TOKEN, "HOST", cmd_host)
DEF_CMD (S_ANY, 0, "INCLUDE", cmd_include)
DEF_CMD (S_ANY, 0, "N OF CASES", cmd_n_of_cases)
DEF_CMD (S_ANY, F_ABBREV, "N", cmd_n_of_cases)
--
"The road to hell is paved with convenient shortcuts."
--Peter da Silva
--
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.
signature.asc
Description: Digital signature