TESTS_ENVIRONMENT += EXEEXT=$(EXEEXT)
dist_TESTS = \
- tests/command/n_of_cases.sh \
tests/command/npar-binomial.sh \
tests/command/npar-chisquare.sh \
tests/command/npar-wilcoxon.sh \
+++ /dev/null
-#!/bin/sh
-
-# This program tests the N OF CASES command to make sure
-# that it actually works.
-
-TEMPDIR=/tmp/pspp-tst-$$
-TESTFILE=$TEMPDIR/`basename $0`.sps
-
-# ensure that top_srcdir and top_builddir are absolute
-if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
-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$EXEEXT
-
-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
-
-cat > $TESTFILE <<EOF
-INPUT PROGRAM.
-LOOP #I = 1 TO 100.
-COMPUTE X=#I.
-END CASE.
-END LOOP.
-END FILE.
-END INPUT PROGRAM.
-
-N OF CASES 15.
-
-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
-X
-1.00
-2.00
-3.00
-4.00
-5.00
-6.00
-7.00
-8.00
-9.00
-10.00
-11.00
-12.00
-13.00
-14.00
-15.00
-EOF
-if [ $? -ne 0 ] ; then fail ; fi
-
-
-pass;
AT_CHECK([pspp -O format=csv erase.sps])
AT_CHECK([test ! -e foobar])
AT_CLEANUP
+
+AT_BANNER([N OF CASES])
+
+AT_SETUP([N OF CASES])
+AT_DATA([n-of-cases.sps], [dnl
+INPUT PROGRAM.
+LOOP #i = 1 TO 100.
+COMPUTE x=#i.
+END CASE.
+END LOOP.
+END FILE.
+END INPUT PROGRAM.
+
+N OF CASES 15.
+
+LIST.
+])
+AT_CHECK([pspp -O format=csv n-of-cases.sps], [0], [dnl
+Table: Data List
+x
+1.00
+2.00
+3.00
+4.00
+5.00
+6.00
+7.00
+8.00
+9.00
+10.00
+11.00
+12.00
+13.00
+14.00
+15.00
+])
+AT_CLEANUP