tests/bugs/compression.sh \
tests/bugs/curtailed.sh \
tests/bugs/data-crash.sh \
- tests/bugs/get.sh \
- tests/bugs/get-no-file.sh \
tests/bugs/if_crash.sh \
tests/bugs/input-crash.sh \
tests/bugs/multipass.sh \
tests/language/data-io/get-data-gnm.at \
tests/language/data-io/get-data-psql.at \
tests/language/data-io/get-data-txt.at \
+ tests/language/data-io/get.at \
tests/language/data-io/list.at \
tests/language/data-io/match-files.at \
tests/language/data-io/print.at \
+++ /dev/null
-#!/bin/sh
-
-# This program tests for a bug which caused a crash when
-# GET specified a non-existent file
-
-TEMPDIR=/tmp/pspp-tst-$$
-TESTFILE=$TEMPDIR/`basename $0`.sps
-
-# ensure that top_builddir are absolute
-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$EXEEXT
-
-# ensure that top_srcdir is absolute
-top_srcdir=`cd $top_srcdir; pwd`
-
-STAT_CONFIG_PATH=$top_srcdir/config
-export STAT_CONFIG_PATH
-
-
-cleanup()
-{
- if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
- echo "NOT cleaning $TEMPDIR"
- return ;
- fi
- cd /
- rm -rf $TEMPDIR
-}
-
-
-fail()
-{
- echo $activity
- echo FAILED
- cleanup;
- exit 1;
-}
-
-
-no_result()
-{
- echo $activity
- echo NO RESULT;
- cleanup;
- exit 2;
-}
-
-pass()
-{
- cleanup;
- exit 0;
-}
-
-mkdir -p $TEMPDIR
-
-cd $TEMPDIR
-
-activity="create program"
-cat > $TESTFILE <<EOF
-GET /FILE='$TEMPDIR/no-file.xx'.
-EOF
-if [ $? -ne 0 ] ; then no_result ; fi
-
-
-# The command should produce a warning. Not an error.
-# We use the stdinput here, because the bug seems to manifest itself only in
-# interactive mode.
-activity="run program"
-cat $TESTFILE | $SUPERVISOR $PSPP -o pspp.csv > /dev/null
-if [ $? -ne 1 ] ; then fail ; fi
-
-pass
+++ /dev/null
-#!/bin/sh
-
-# This program tests for a bug which caused
-# the second procedure after GET FILE to corrupt its output
-
-
-TEMPDIR=/tmp/pspp-tst-$$
-TESTFILE=$TEMPDIR/`basename $0`.sps
-
-# ensure that top_builddir are absolute
-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$EXEEXT
-
-# ensure that top_srcdir is absolute
-top_srcdir=`cd $top_srcdir; pwd`
-
-STAT_CONFIG_PATH=$top_srcdir/config
-export STAT_CONFIG_PATH
-
-
-cleanup()
-{
- if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
- echo "NOT cleaning $TEMPDIR"
- return ;
- fi
- cd /
- rm -rf $TEMPDIR
-}
-
-
-fail()
-{
- echo $activity
- echo FAILED
- cleanup;
- exit 1;
-}
-
-
-no_result()
-{
- echo $activity
- echo NO RESULT;
- cleanup;
- exit 2;
-}
-
-pass()
-{
- cleanup;
- exit 0;
-}
-
-mkdir -p $TEMPDIR
-
-cd $TEMPDIR
-
-activity="create program"
-cat > $TESTFILE <<EOF
-DATA LIST LIST NOTABLE /LOCATION * EDITOR * SHELL * FREQ * .
-BEGIN DATA.
- 1.00 1.00 1.0 2.00
- 1.00 1.00 2.0 30.00
- 1.00 2.00 1.0 8.00
- 1.00 2.00 2.0 20.00
- 2.00 1.00 1.0 2.00
- 2.00 1.00 2.0 22.00
- 2.00 2.00 1.0 1.00
- 2.00 2.00 2.0 3.00
-END DATA.
-
-SAVE /OUTFILE='$TEMPDIR/foo.sav'.
-
-GET /FILE='$TEMPDIR/foo.sav'.
-
-* This one's ok
-LIST.
-
-* But this one get rubbish
-LIST.
-
-EOF
-if [ $? -ne 0 ] ; then no_result ; fi
-
-
-activity="run program"
-$SUPERVISOR $PSPP -o pspp.csv $TESTFILE
-if [ $? -ne 0 ] ; then no_result ; fi
-
-
-
-
-activity="compare output"
-diff -c $TEMPDIR/pspp.csv - << EOF
-Table: Data List
-LOCATION,EDITOR,SHELL,FREQ
-1.00,1.00,1.00,2.00
-1.00,1.00,2.00,30.00
-1.00,2.00,1.00,8.00
-1.00,2.00,2.00,20.00
-2.00,1.00,1.00,2.00
-2.00,1.00,2.00,22.00
-2.00,2.00,1.00,1.00
-2.00,2.00,2.00,3.00
-
-Table: Data List
-LOCATION,EDITOR,SHELL,FREQ
-1.00,1.00,1.00,2.00
-1.00,1.00,2.00,30.00
-1.00,2.00,1.00,8.00
-1.00,2.00,2.00,20.00
-2.00,1.00,1.00,2.00
-2.00,1.00,2.00,22.00
-2.00,2.00,1.00,1.00
-2.00,2.00,2.00,3.00
-EOF
-if [ $? -ne 0 ] ; then fail ; fi
-
-pass;
--- /dev/null
+AT_BANNER([GET])
+
+dnl Tests for a bug which caused the second procedure
+dnl after GET to have corrupt input.
+AT_SETUP([GET data works in multiple procedures])
+AT_DATA([get.sps], [dnl
+DATA LIST LIST NOTABLE /LOCATION * EDITOR * SHELL * FREQ * .
+BEGIN DATA.
+ 1.00 1.00 1.0 2.00
+ 1.00 1.00 2.0 30.00
+ 1.00 2.00 1.0 8.00
+ 1.00 2.00 2.0 20.00
+ 2.00 1.00 1.0 2.00
+ 2.00 1.00 2.0 22.00
+ 2.00 2.00 1.0 1.00
+ 2.00 2.00 2.0 3.00
+END DATA.
+
+SAVE /OUTFILE='foo.sav'.
+
+GET /FILE='foo.sav'.
+
+* This one's ok
+LIST.
+
+* But this one get rubbish
+LIST.
+])
+AT_CHECK([pspp -o pspp.csv get.sps])
+AT_CHECK([cat pspp.csv], [0], [dnl
+Table: Data List
+LOCATION,EDITOR,SHELL,FREQ
+1.00,1.00,1.00,2.00
+1.00,1.00,2.00,30.00
+1.00,2.00,1.00,8.00
+1.00,2.00,2.00,20.00
+2.00,1.00,1.00,2.00
+2.00,1.00,2.00,22.00
+2.00,2.00,1.00,1.00
+2.00,2.00,2.00,3.00
+
+Table: Data List
+LOCATION,EDITOR,SHELL,FREQ
+1.00,1.00,1.00,2.00
+1.00,1.00,2.00,30.00
+1.00,2.00,1.00,8.00
+1.00,2.00,2.00,20.00
+2.00,1.00,1.00,2.00
+2.00,1.00,2.00,22.00
+2.00,2.00,1.00,1.00
+2.00,2.00,2.00,3.00
+])
+AT_CLEANUP
+
+dnl Tests for a bug that crashed when GET specified a nonexistent file.
+AT_SETUP([GET nonexistent file doesn't crash])
+dnl We use stdin here, because the bug seems to manifest itself only in
+dnl interactive mode.
+AT_CHECK([echo "GET /FILE='nonexistent.sav'." | pspp -O format=csv], [1], [dnl
+error: An error occurred while opening `nonexistent.sav': No such file or directory.
+
+-:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
+])
+AT_CLEANUP