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
40 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
41 echo "NOT cleaning $TEMPDIR"
76 activity="create program"
77 cat > $TEMPDIR/print.stat << foobar
78 data list notable /x y 1-2.
92 print outfile='print.out' /x y.
93 print eject outfile='print.out' /x y (f1,f1).
94 print outfile='print.out' /x '-' y.
95 print outfile='print.out'.
97 write outfile='write.out' /x y.
98 write outfile='write.out' /x y (2(f1)).
99 write outfile='write.out' /x '-' y.
100 write outfile='write.out'.
104 if [ $? -ne 0 ] ; then no_result ; fi
107 activity="run program"
108 $SUPERVISOR $PSPP --testing-mode --error-file=$TEMPDIR/errs $TEMPDIR/print.stat
109 if [ $? -ne 0 ] ; then fail ; fi
111 activity="compare print.out"
112 diff $TEMPDIR/print.out - <<EOF
134 if [ $? -ne 0 ] ; then fail ; fi
136 activity="compare write.out"
137 diff $TEMPDIR/write.out - <<EOF
159 if [ $? -ne 0 ] ; then fail ; fi
161 activity="compare output"
162 diff $TEMPDIR/pspp.list - << EOF
189 if [ $? -ne 0 ] ; then fail ; fi