3 # This program tests the LOOP command
5 TEMPDIR=/tmp/pspp-tst-$$
9 # ensure that top_srcdir is absolute
10 cd $top_srcdir; top_srcdir=`pwd`
12 export STAT_CONFIG_PATH=$top_srcdir/config
48 activity="create prog"
49 cat > $TEMPDIR/loop.stat <<EOF
50 data list /x 1 y 2 z 3.
57 loop i=y to z by abs(z-y)/(z-y).
59 break. /* Generates warning.
63 if [ $? -ne 0 ] ; then no_result ; fi
65 activity="run program"
66 $SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TEMPDIR/loop.stat > $TEMPDIR/stdout
67 if [ $? -ne 0 ] ; then no_result ; fi
69 activity="compare stdout"
70 diff -B -b $TEMPDIR/stdout - <<EOF
71 $TEMPDIR/loop.stat:10: warning: BREAK: BREAK not enclosed in DO IF structure.
73 if [ $? -ne 0 ] ; then fail ; fi
75 activity="compare results"
76 diff -B -b $TEMPDIR/pspp.list - <<EOF
77 1.1 DATA LIST. Reading 1 record from the command file.
78 +--------+------+-------+------+
79 |Variable|Record|Columns|Format|
80 #========#======#=======#======#
84 +--------+------+-------+------+
90 if [ $? -ne 0 ] ; then fail ; fi