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