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