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$EXEEXT
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
23 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
24 echo "NOT cleaning $TEMPDIR"
60 activity="create test syntax"
62 * By including at least one command in the input, we can ensure that PSPP
63 also doesn't crash trying to create pspp.jnl in an unwritable directory.
65 * By outputting a chart, we can check that charts are safe too.
73 frequencies x/histogram.
75 if [ $? -ne 0 ] ; then no_result ; fi
77 # Mark our directory unwritable.
80 # Iterate over the various drivers we support. We could use all of these
81 # on a single PSPP invocation, except that charts are only supported for
82 # a single driver at a time, and we'd prefer to test chart support for
83 # all of our driver types.
84 for file in pspp.csv pspp.html pspp.odt pspp.pdf pspp.txt; do
85 # PSPP will fail to create the output file. Currently this doesn't cause
86 # PSPP's exit status to be nonzero, although this is arguably incorrect.
87 # At any rate, PSPP should not crash.
88 activity="run pspp with $file driver"
89 $SUPERVISOR $PSPP -o $file test.pspp >/dev/null 2>&1
90 if [ $? -ne 0 ] ; then fail ; fi