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 export STAT_CONFIG_PATH=$top_srcdir/config
49 activity="create prog"
50 cat > $TEMPDIR/loop.stat <<EOF
51 data list /X 1 Y 2 ZOOLOGICAL 3.
58 loop iterative_Variable=y to zoological by abs(zoological-y)/(zoological-y).
59 print /x iterative_Variable.
60 break. /* Generates warning.
64 if [ $? -ne 0 ] ; then no_result ; fi
66 activity="run program"
67 $SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TEMPDIR/loop.stat > $TEMPDIR/stdout
68 if [ $? -ne 0 ] ; then no_result ; fi
70 activity="compare stdout"
71 diff -B -b $TEMPDIR/stdout - <<EOF
72 $TEMPDIR/loop.stat:10: warning: BREAK: BREAK not enclosed in DO IF structure.
74 if [ $? -ne 0 ] ; then fail ; fi
76 activity="compare results"
77 diff -B -b $TEMPDIR/pspp.list - <<EOF
78 1.1 DATA LIST. Reading 1 record from the command file.
79 +----------+------+-------+------+
80 | Variable |Record|Columns|Format|
81 #==========#======#=======#======#
84 |ZOOLOGICAL| 1| 3- 3|F1.0 |
85 +----------+------+-------+------+
91 if [ $? -ne 0 ] ; then fail ; fi