3 # This program tests the DATA LIST input program.
5 TEMPDIR=/tmp/pspp-tst-$$
6 TESTFILE=$TEMPDIR/`basename $0`.sps
8 # ensure that top_builddir are absolute
9 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
10 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
11 top_builddir=`cd $top_builddir; pwd`
12 PSPP=$top_builddir/src/ui/terminal/pspp
14 # ensure that top_srcdir is absolute
15 top_srcdir=`cd $top_srcdir; pwd`
17 STAT_CONFIG_PATH=$top_srcdir/config
18 export STAT_CONFIG_PATH
23 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
24 echo "NOT cleaning $TEMPDIR"
59 # Create command file.
60 activity="create program"
61 cat > $TESTFILE << EOF
62 data list list ('|','X') /A B C D.
71 data list free skip=1/A B C D.
73 # This record is ignored.
89 data list free (tab) skip=2/A B C D.
112 * Test DATA LIST FIXED with multiple records.
113 data list fixed notable
114 /1 start 1-20 (adate)
130 * Test that DATA LIST FIXED works with an empty trailing record.
131 data list fixed notable records=2/x 1 y 2.
146 if [ $? -ne 0 ] ; then no_result ; fi
149 activity="run program"
150 $SUPERVISOR $PSPP --testing-mode $TESTFILE
151 if [ $? -ne 0 ] ; then fail ; fi
153 activity="compare output"
154 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
155 diff -b $TEMPDIR/pspp.list - << EOF
156 1.1 DATA LIST. Reading free-form data from INLINE.
166 -------- -------- -------- --------
167 1.00 23.00 45.00 2.03
168 2.00 22.00 34.00 23.00
169 3.00 34.00 34.00 34.00
171 -------- -------- -------- --------
179 -------- -------- -------- --------
197 -------------------- -------------------- -----
198 07/22/2007 10/06/2007 321
199 07/14/1789 08/26/1789 4
200 01/01/1972 12/31/1999 682
209 if [ $? -ne 0 ] ; then fail ; fi