3 # This program tests unusual aspects of the PRINT and WRITE
6 # - PRINT puts spaces between variables, unless a format
7 # is specified explicitly.
9 # - WRITE doesn't put space between variables.
11 # - PRINT to an external file prefixes each line with a space.
13 # - PRINT EJECT to an external file indicates a formfeed by a "1"
14 # in the first column.
16 # - WRITE writes out spaces for system-missing values, not a period.
18 # - When no output is specified, an empty record is output.
20 TEMPDIR=/tmp/pspp-tst-$$
21 TESTFILE=$TEMPDIR/`basename $0`.sps
23 # ensure that top_builddir are absolute
24 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
25 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
26 top_builddir=`cd $top_builddir; pwd`
27 PSPP=$top_builddir/src/ui/terminal/pspp
29 # ensure that top_srcdir is absolute
30 top_srcdir=`cd $top_srcdir; pwd`
32 STAT_CONFIG_PATH=$top_srcdir/config
33 export STAT_CONFIG_PATH
72 activity="create program"
73 cat > $TEMPDIR/print.stat << foobar
74 data list notable /x y 1-2.
88 print outfile='print.out' /x y.
89 print eject outfile='print.out' /x y (f1,f1).
90 print outfile='print.out' /x '-' y.
91 print outfile='print.out'.
93 write outfile='write.out' /x y.
94 write outfile='write.out' /x y (2(f1)).
95 write outfile='write.out' /x '-' y.
96 write outfile='write.out'.
100 if [ $? -ne 0 ] ; then no_result ; fi
103 activity="run program"
104 $SUPERVISOR $PSPP --testing-mode -o raw-ascii --testing-mode --error-file=$TEMPDIR/errs $TEMPDIR/print.stat
105 if [ $? -ne 0 ] ; then fail ; fi
107 activity="compare print.out"
108 diff $TEMPDIR/print.out - <<EOF
130 if [ $? -ne 0 ] ; then fail ; fi
132 activity="compare write.out"
133 diff $TEMPDIR/write.out - <<EOF
155 if [ $? -ne 0 ] ; then fail ; fi
157 activity="compare output"
158 diff $TEMPDIR/pspp.list - << EOF
185 if [ $? -ne 0 ] ; then fail ; fi