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`
13 PSPP=$top_builddir/src/ui/terminal/pspp
15 # ensure that top_srcdir is absolute
16 top_srcdir=`cd $top_srcdir; pwd`
18 STAT_CONFIG_PATH=$top_srcdir/config
19 export STAT_CONFIG_PATH
26 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
27 echo "NOT cleaning $TEMPDIR"
62 activity="create program"
64 /* Tries AUTORECODE on some random but similar strings of characters.
65 data list /X 1-5(a) Y 7.
68 asdfk 0 3 <---- These are the numbers that should be produced for a 4
74 asdfk 0 3 These are the numbers that should be produced for b ----> 4
78 autorecode x y into A B/descend.
81 /* Just to make sure it works on second & subsequent executions,
87 if [ $? -ne 0 ] ; then no_result ; fi
89 activity="run program"
90 $SUPERVISOR $PSPP --testing-mode $TESTFILE
91 if [ $? -ne 0 ] ; then no_result ; fi
93 activity="test output"
94 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
95 diff -b $TEMPDIR/pspp.list - <<EOF
96 1.1 DATA LIST. Reading 1 record from INLINE.
97 +--------+------+-------+------+
98 |Variable|Record|Columns|Format|
99 #========#======#=======#======#
102 +--------+------+-------+------+
104 ----- - -------- --------
115 ----- - -------- -------- -------- --------
116 lasdj 1 1.00 3.00 .00 1.00
117 asdfk 0 3.00 4.00 .00 1.00
118 asdfj 2 4.00 2.00 1.00 2.00
119 asdfj 1 4.00 3.00 .00 1.00
120 asdfk 2 3.00 2.00 1.00 2.00
121 asdfj 9 4.00 1.00 4.00 3.00
122 lajks 9 2.00 1.00 4.00 3.00
123 asdfk 0 3.00 4.00 .00 1.00
124 asdfk 1 3.00 3.00 .00 1.00
126 if [ $? -ne 0 ] ; then fail ; fi