3 # This program tests the autorecode command
5 TEMPDIR=/tmp/pspp-tst-$$
6 TESTFILE=$TEMPDIR/`basename $0`.sps
11 # ensure that top_srcdir is absolute
12 cd $top_srcdir; top_srcdir=`pwd`
14 STAT_CONFIG_PATH=$top_srcdir/config
15 export STAT_CONFIG_PATH
52 activity="create program"
54 /* Tries AUTORECODE on some random but similar strings of characters.
55 data list /X 1-5(a) Y 7.
58 asdfk 0 3 <---- These are the numbers that should be produced for a 4
64 asdfk 0 3 These are the numbers that should be produced for b ----> 4
68 autorecode x y into A B/descend.
71 /* Just to make sure it works on second & subsequent executions,
77 if [ $? -ne 0 ] ; then no_result ; fi
79 activity="run program"
80 $SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE
81 if [ $? -ne 0 ] ; then no_result ; fi
83 activity="test output"
84 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
85 diff -b $TEMPDIR/pspp.list - <<EOF
86 1.1 DATA LIST. Reading 1 record from INLINE.
87 +--------+------+-------+------+
88 |Variable|Record|Columns|Format|
89 #========#======#=======#======#
92 +--------+------+-------+------+
94 ----- - -------- --------
105 ----- - -------- -------- -------- --------
106 lasdj 1 1.00 3.00 .00 1.00
107 asdfk 0 3.00 4.00 .00 1.00
108 asdfj 2 4.00 2.00 1.00 2.00
109 asdfj 1 4.00 3.00 .00 1.00
110 asdfk 2 3.00 2.00 1.00 2.00
111 asdfj 9 4.00 1.00 4.00 3.00
112 lajks 9 2.00 1.00 4.00 3.00
113 asdfk 0 3.00 4.00 .00 1.00
114 asdfk 1 3.00 3.00 .00 1.00
116 if [ $? -ne 0 ] ; then fail ; fi