X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fbugs%2Foverwrite-input-file.sh;h=f1beabcca59d37aebeda13163816dba823a4fb1c;hb=5933892c21c6166b5714be979116d3aa70219c57;hp=185de8b482b5c92493869e198740a9dd3708a88e;hpb=707848060e414fe93458834446dd7cdbf800667f;p=pspp diff --git a/tests/bugs/overwrite-input-file.sh b/tests/bugs/overwrite-input-file.sh index 185de8b482..f1beabcca5 100755 --- a/tests/bugs/overwrite-input-file.sh +++ b/tests/bugs/overwrite-input-file.sh @@ -11,7 +11,7 @@ TESTFILE=$TEMPDIR/`basename $0`.sps if [ -z "$top_builddir" ] ; then top_builddir=. ; fi if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi top_builddir=`cd $top_builddir; pwd` -PSPP=$top_builddir/src/ui/terminal/pspp +PSPP=$top_builddir/src/ui/terminal/pspp$EXEEXT # ensure that top_srcdir is absolute top_srcdir=`cd $top_srcdir; pwd` @@ -22,6 +22,10 @@ export STAT_CONFIG_PATH cleanup() { + if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then + echo "NOT cleaning $TEMPDIR" + return ; + fi cd / rm -rf $TEMPDIR } @@ -73,7 +77,7 @@ EOF if [ $? -ne 0 ] ; then no_result ; fi activity="run program 1" -$SUPERVISOR $PSPP --testing-mode $TESTFILE +$SUPERVISOR $PSPP -o pspp.csv $TESTFILE if [ $? -ne 0 ] ; then no_result ; fi activity="check and save copy of output files" @@ -94,12 +98,12 @@ COMPUTE Y = X + 1. XSAVE OUTFILE='foo.sav'. XEXPORT OUTFILE='foo.por'. PRINT OUTFILE='foo.data'. -HOST kill -TERM \$PPID +HOST COMMAND=['kill -TERM \$PPID']. EOF if [ $? -ne 0 ] ; then no_result ; fi activity="run program 2" -{ $SUPERVISOR $PSPP --testing-mode $TESTFILE -e /dev/null; } >/dev/null 2>&1 +{ $SUPERVISOR $PSPP -o pspp.csv $TESTFILE -e /dev/null; } >/dev/null 2>&1 # PSPP should have terminated with a signal. POSIX requires that the exit # status of a process terminated by a signal be greater than 128. if [ $? -le 128 ] ; then no_result ; fi @@ -138,7 +142,7 @@ EOF if [ $? -ne 0 ] ; then no_result ; fi activity="run program 3" -$SUPERVISOR $PSPP --testing-mode $TESTFILE -e /dev/null +$SUPERVISOR $PSPP -o pspp.csv $TESTFILE -e /dev/null if [ $? -ne 0 ] ; then no_result ; fi activity="check for remaining temporary files" @@ -158,34 +162,34 @@ EOF if [ $? -ne 0 ] ; then no_result ; fi activity="run program 4" -$SUPERVISOR $PSPP --testing-mode $TESTFILE -e /dev/null +$SUPERVISOR $PSPP -o pspp.csv $TESTFILE -e /dev/null if [ $? -ne 0 ] ; then no_result ; fi activity="compare output" -diff -b -B pspp.list - << EOF - X Y --------- -------- - 1.00 2.00 - 2.00 3.00 - 3.00 4.00 - 4.00 5.00 - 5.00 6.00 - -X Y -- -------- -1 3.00 -2 4.00 -3 5.00 -4 6.00 -5 7.00 - -X Y -- -------- -1 4.00 -2 5.00 -3 6.00 -4 7.00 -5 8.00 +diff -c pspp.csv - << EOF +Table: Data List +X,Y +1.00,2.00 +2.00,3.00 +3.00,4.00 +4.00,5.00 +5.00,6.00 + +Table: Data List +X,Y +1,3.00 +2,4.00 +3,5.00 +4,6.00 +5,7.00 + +Table: Data List +X,Y +1,4.00 +2,5.00 +3,6.00 +4,7.00 +5,8.00 EOF if [ $? -ne 0 ] ; then fail ; fi