3 # This program tests the LOOP command
5 TEMPDIR=/tmp/pspp-tst-$$
6 TESTFILE=$TEMPDIR/`basename $0`.sps
10 # ensure that top_srcdir is absolute
11 cd $top_srcdir; top_srcdir=`pwd`
13 STAT_CONFIG_PATH=$top_srcdir/config
14 export STAT_CONFIG_PATH
51 activity="create prog"
52 cat > $TEMPDIR/loop.stat <<EOF
53 data list /X 1 Y 2 ZOOLOGICAL 3.
60 loop iterative_Variable=y to zoological by abs(zoological-y)/(zoological-y).
61 print /x iterative_Variable.
62 break. /* Generates warning.
66 if [ $? -ne 0 ] ; then no_result ; fi
68 activity="run program"
69 $SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TEMPDIR/loop.stat > $TEMPDIR/stdout
70 if [ $? -ne 0 ] ; then no_result ; fi
72 activity="compare stdout"
73 perl -pi -e 's/^\s*$//g' $TEMPDIR/stdout
74 diff -b $TEMPDIR/stdout - <<EOF |perl -e 's/^\s*$//g'
75 $TEMPDIR/loop.stat:10: warning: BREAK: BREAK not enclosed in DO IF structure.
77 if [ $? -ne 0 ] ; then fail ; fi
79 activity="compare results"
80 perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
81 diff -b $TEMPDIR/pspp.list - <<EOF | perl -e 's/^\s*$//g'
82 1.1 DATA LIST. Reading 1 record from the command file.
83 +----------+------+-------+------+
84 | Variable |Record|Columns|Format|
85 #==========#======#=======#======#
88 |ZOOLOGICAL| 1| 3- 3|F1.0 |
89 +----------+------+-------+------+
95 if [ $? -ne 0 ] ; then fail ; fi