TESTS_ENVIRONMENT += EXEEXT=$(EXEEXT)
dist_TESTS = \
- tests/command/lag.sh \
tests/command/line-ends.sh \
tests/command/list.sh \
tests/command/loop.sh \
tests/bugs/get-no-file.sh \
tests/bugs/if_crash.sh \
tests/bugs/input-crash.sh \
- tests/bugs/lag_crash.sh \
tests/bugs/list-overflow.sh \
tests/bugs/match-files-scratch.sh \
tests/bugs/multipass.sh \
+++ /dev/null
-#!/bin/sh
-
-# This program tests for a bug which crashed pspp when using LAG
-
-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 /x.
-BEGIN DATA
-1
-2
-END DATA.
-
-DO IF (x <> LAG(x) ).
- ECHO 'hello'.
-END IF.
-
-EXECUTE.
-EOF
-if [ $? -ne 0 ] ; then no_result ; fi
-
-
-activity="run_program"
-$SUPERVISOR $PSPP -o pspp.csv $TESTFILE
-if [ $? -ne 0 ] ; then fail ; fi
-
-
-pass;
+++ /dev/null
-#!/bin/sh
-
-# This program tests the LAG function
-
-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
-
-LANG=C
-export LANG
-
-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 > $TEMPDIR/lag.stat <<EOF
-data list /W 1.
-begin data.
-1
-2
-3
-4
-5
-end data.
-
-compute X=lag(w,1).
-compute Y=lag(x).
-compute Z=lag(w,2).
-list.
-EOF
-if [ $? -ne 0 ] ; then no_result ; fi
-
-activity="run program"
-$SUPERVISOR $PSPP -o pspp.csv $TEMPDIR/lag.stat
-if [ $? -ne 0 ] ; then no_result ; fi
-
-activity="compare result"
-diff -c $TEMPDIR/pspp.csv - <<EOF
-Table: Reading 1 record from INLINE.
-Variable,Record,Columns,Format
-W,1,1- 1,F1.0
-
-Table: Data List
-W,X,Y,Z
-1,. ,. ,.
-2,1.00,. ,.
-3,2.00,1.00,1.00
-4,3.00,2.00,2.00
-5,4.00,3.00,3.00
-EOF
-if [ $? -ne 0 ] ; then fail ; fi
-
-
-pass;
[[mod(0, x)], [0.00], [], [(X = 5.00)]],
[[x ** 1], [5.00], [], [(X = 5.00)]],
[[x ** 2], [25.00], [], [(X = 5.00)]])
+
+AT_SETUP([LAG function])
+AT_DATA([lag.sps], [dnl
+data list /W 1.
+begin data.
+1
+2
+3
+4
+5
+end data.
+
+compute X=lag(w,1).
+compute Y=lag(x).
+compute Z=lag(w,2).
+list.
+])
+AT_CHECK([pspp -o pspp.csv lag.sps])
+AT_CHECK([cat pspp.csv], [0], [dnl
+Table: Reading 1 record from INLINE.
+Variable,Record,Columns,Format
+W,1,1- 1,F1.0
+
+Table: Data List
+W,X,Y,Z
+1,. ,. ,. @&t@
+2,1.00,. ,. @&t@
+3,2.00,1.00,1.00
+4,3.00,2.00,2.00
+5,4.00,3.00,3.00
+])
+AT_CLEANUP
+
+AT_SETUP([LAG crash bug])
+AT_DATA([lag.sps], [dnl
+DATA LIST LIST /x.
+BEGIN DATA
+1
+2
+END DATA.
+
+DO IF (x <> LAG(x) ).
+ ECHO 'hello'.
+END IF.
+
+EXECUTE.
+])
+AT_CHECK([pspp -o pspp.csv lag.sps])
+AT_CHECK([cat pspp.csv], [0], [dnl
+Table: Reading free-form data from INLINE.
+Variable,Format
+x,F8.0
+
+hello
+])
+AT_CLEANUP