3 # This program tests the autorecode command
5 TEMPDIR=/tmp/pspp-tst-$$
9 # ensure that top_srcdir is absolute
10 cd $top_srcdir; top_srcdir=`pwd`
12 export STAT_CONFIG_PATH=$top_srcdir/config
48 activity="create program"
49 cat > $TEMPDIR/prog.sps <<EOF
50 /* Tries AUTORECODE on some random but similar strings of characters.
51 data list /x 1-5(a) y 7.
54 asdfk 0 3 <---- These are the numbers that should be produced for a 4
60 asdfk 0 3 These are the numbers that should be produced for b ----> 4
64 autorecode x y into a b/descend.
67 /* Just to make sure it works on second & subsequent executions,
73 if [ $? -ne 0 ] ; then no_result ; fi
75 activity="run program"
76 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps
77 if [ $? -ne 0 ] ; then no_result ; fi
79 activity="test output"
80 diff -b -B $TEMPDIR/pspp.list - <<EOF
81 1.1 DATA LIST. Reading 1 record from the command file.
82 +--------+------+-------+------+
83 |Variable|Record|Columns|Format|
84 #========#======#=======#======#
87 +--------+------+-------+------+
90 ----- - -------- --------
102 ----- - -------- -------- -------- --------
103 lasdj 1 1.00 3.00 .00 1.00
104 asdfk 0 3.00 4.00 .00 1.00
105 asdfj 2 4.00 2.00 1.00 2.00
106 asdfj 1 4.00 3.00 .00 1.00
107 asdfk 2 3.00 2.00 1.00 2.00
108 asdfj 9 4.00 1.00 4.00 3.00
109 lajks 9 2.00 1.00 4.00 3.00
110 asdfk 0 3.00 4.00 .00 1.00
111 asdfk 1 3.00 3.00 .00 1.00
113 if [ $? -ne 0 ] ; then fail ; fi