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 diff -B -b $TEMPDIR/stdout - <<EOF
74 $TEMPDIR/loop.stat:10: warning: BREAK: BREAK not enclosed in DO IF structure.
76 if [ $? -ne 0 ] ; then fail ; fi
78 activity="compare results"
79 diff -B -b $TEMPDIR/pspp.list - <<EOF
80 1.1 DATA LIST. Reading 1 record from the command file.
81 +----------+------+-------+------+
82 | Variable |Record|Columns|Format|
83 #==========#======#=======#======#
86 |ZOOLOGICAL| 1| 3- 3|F1.0 |
87 +----------+------+-------+------+
93 if [ $? -ne 0 ] ; then fail ; fi