TESTS_ENVIRONMENT += EXEEXT=$(EXEEXT)
dist_TESTS = \
- tests/command/split-file.sh \
tests/command/t-test-1-indep-val.sh \
tests/command/t-test-1-sample-missing-anal.sh \
tests/command/t-test-1-sample-missing-list.sh \
tests/language/dictionary/missing-values.at \
tests/language/dictionary/mrsets.at \
tests/language/dictionary/rename-variables.at \
+ tests/language/dictionary/split-file.at \
tests/language/dictionary/sys-file-info.at \
tests/language/expressions/evaluate.at \
tests/language/lexer/variable-parser.at \
+++ /dev/null
-#!/bin/sh
-
-# This program tests the split file command
-
-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/split.stat <<EOF
-title 'Test SPLIT FILE utility'.
-
-data list notable /X 1 Y 2.
-begin data.
-12
-16
-17
-19
-15
-14
-27
-20
-26
-25
-28
-29
-24
-end data.
-split file by x.
-list.
-EOF
-if [ $? -ne 0 ] ; then no_result ; fi
-
-activity="run program"
-$SUPERVISOR $PSPP -o pspp.csv $TEMPDIR/split.stat
-if [ $? -ne 0 ] ; then no_result ; fi
-
-activity="compare results"
-diff -c $TEMPDIR/pspp.csv - <<EOF
-Title: Test SPLIT FILE utility
-
-Variable,Value,Label
-X,1,
-
-Table: Data List
-X,Y
-1,2
-1,6
-1,7
-1,9
-1,5
-1,4
-
-Variable,Value,Label
-X,2,
-
-Table: Data List
-X,Y
-2,7
-2,0
-2,6
-2,5
-2,8
-2,9
-2,4
-EOF
-if [ $? -ne 0 ] ; then fail ; fi
-
-pass;
--- /dev/null
+AT_BANNER([SPLIT FILE])
+
+AT_SETUP([SPLIT FILE])
+AT_DATA([split-file.sps], [dnl
+title 'Test SPLIT FILE utility'.
+
+data list notable /X 1 Y 2.
+begin data.
+12
+16
+17
+19
+15
+14
+27
+20
+26
+25
+28
+29
+24
+end data.
+split file by x.
+list.
+])
+AT_CHECK([pspp -o pspp.csv split-file.sps])
+AT_CHECK([cat pspp.csv], [0], [dnl
+Title: Test SPLIT FILE utility
+
+Variable,Value,Label
+X,1,
+
+Table: Data List
+X,Y
+1,2
+1,6
+1,7
+1,9
+1,5
+1,4
+
+Variable,Value,Label
+X,2,
+
+Table: Data List
+X,Y
+2,7
+2,0
+2,6
+2,5
+2,8
+2,9
+2,4
+])
+AT_CLEANUP