3 # This program tests for a bug which crashed pspp when output drivers
4 # tried to create output files in an unwritable directory.
6 TEMPDIR=/tmp/pspp-tst-$$
8 # ensure that top_builddir are absolute
9 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
10 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
11 top_builddir=`cd $top_builddir; pwd`
12 PSPP=$top_builddir/src/ui/terminal/pspp
14 # ensure that top_srcdir is absolute
15 top_srcdir=`cd $top_srcdir; pwd`
17 STAT_CONFIG_PATH=$top_srcdir/config
18 export STAT_CONFIG_PATH
56 activity="create test syntax"
58 * By including at least one command in the input, we can ensure that PSPP
59 also doesn't crash trying to create pspp.jnl in an unwritable directory.
61 * By outputting a chart, we can check that charts are safe too.
69 frequencies x/histogram.
71 if [ $? -ne 0 ] ; then no_result ; fi
73 # Mark our directory unwritable.
76 # Iterate over the various drivers we support. We could use all of these
77 # on a single PSPP invocation, except that charts are only supported for
78 # a single driver at a time, and we'd prefer to test chart support for
79 # all of our driver types.
80 for driver in list-ascii list-ps html; do
81 # PSPP will fail to create the output file. Currently this doesn't cause
82 # PSPP's exit status to be nonzero, although this is arguably incorrect.
83 # At any rate, PSPP should not crash.
84 activity="run pspp with $driver driver"
85 $SUPERVISOR $PSPP -o $driver test.pspp >/dev/null 2>&1
86 if [ $? -ne 0 ] ; then fail ; fi