# This program tests the ERASE command.
TEMPDIR=/tmp/pspp-tst-$$
+TESTFILE=$TEMPDIR/`basename $0`.sps
-here=`pwd`;
+# ensure that top_builddir are absolute
+if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
+if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
+top_builddir=`cd $top_builddir; pwd`
+PSPP=$top_builddir/src/ui/terminal/pspp
# ensure that top_srcdir is absolute
-cd $top_srcdir; top_srcdir=`pwd`
+top_srcdir=`cd $top_srcdir; pwd`
-export STAT_CONFIG_PATH=$top_srcdir/config
+STAT_CONFIG_PATH=$top_srcdir/config
+export STAT_CONFIG_PATH
cleanup()
{
+ cd /
rm -rf $TEMPDIR
}
activity="create program 1"
-cat > $TEMPDIR/foo.sps <<EOF
+cat > $TESTFILE <<EOF
set safer on
erase FILE='foobar'.
# This command must fail
activity="run prog 1"
-$SUPERVISOR $here/../src/pspp $TEMPDIR/foo.sps > /dev/null
+$SUPERVISOR $PSPP $TESTFILE > /dev/null
if [ $? -eq 0 ] ; then fail ; fi
activity="create program 2"
-cat > $TEMPDIR/foo.sps <<EOF
+cat > $TESTFILE <<EOF
erase FILE='foobar'.
activity="run prog 1"
-$SUPERVISOR $here/../src/pspp $TEMPDIR/foo.sps
+$SUPERVISOR $PSPP $TESTFILE
if [ $? -ne 0 ] ; then fail ; fi
# foobar should now be gone
if [ -f $TEMPDIR/foobar ] ; then fail ; fi
-
-
-
-
-if [ $? -ne 0 ] ; then fail ; fi
-
-
-
pass;