3 # This program tests features of GET DATA /TYPE=TXT input program that
4 # it has in common with DATA LIST, using tests drawn from
7 TEMPDIR=/tmp/pspp-tst-$$
8 TESTFILE=$TEMPDIR/`basename $0`.sps
10 # ensure that top_builddir are absolute
11 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
12 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
13 top_builddir=`cd $top_builddir; pwd`
14 PSPP=$top_builddir/src/ui/terminal/pspp
16 # ensure that top_srcdir is absolute
17 top_srcdir=`cd $top_srcdir; pwd`
19 STAT_CONFIG_PATH=$top_srcdir/config
20 export STAT_CONFIG_PATH
25 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
26 echo "NOT cleaning $TEMPDIR"
61 # Create command file.
62 activity="create program"
63 cat > $TESTFILE << EOF
64 get data /type=txt /file=inline /delimiters="|X"
65 /variables=A f7.2 B f7.2 C f7.2 D f7.2.
74 get data /type=txt /file=inline /delimiters=', ' /delcase=variables 4
75 /firstcase=2 /variables=A f7.2 B f7.2 C f7.2 D f7.2.
77 # This record is ignored.
93 get data /type=txt /file=inline /delimiters='\t' /delcase=variables 4
94 /firstcase=3 /variables=A f7.2 B f7.2 C f7.2 D f7.2.
117 get data /type=txt /file=inline /arrangement=fixed /fixcase=3 /variables=
134 get data /type=txt /file=inline /arrangement=fixed /fixcase=2 /variables=
151 if [ $? -ne 0 ] ; then no_result ; fi
154 activity="run program"
155 $SUPERVISOR $PSPP --testing-mode $TESTFILE
156 if [ $? -ne 0 ] ; then fail ; fi
158 activity="compare output"
159 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
160 diff -b $TEMPDIR/pspp.list - << EOF
162 -------- -------- -------- --------
163 1.00 23.00 45.00 2.03
164 2.00 22.00 34.00 23.00
165 3.00 34.00 34.00 34.00
167 -------- -------- -------- --------
176 -------- -------- -------- --------
194 -------------------- -------------------- -----
195 07/22/2007 10/06/2007 321
196 07/14/1789 08/26/1789 4
197 01/01/1972 12/31/1999 682
206 if [ $? -ne 0 ] ; then fail ; fi