3 # This program tests that compressed system files can be read and written
5 TEMPDIR=/tmp/pspp-tst-$$
6 TESTFILE=$TEMPDIR/`basename $0`.sps
8 # ensure that top_srcdir and top_builddir are absolute
9 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
10 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
11 top_srcdir=`cd $top_srcdir; pwd`
12 top_builddir=`cd $top_builddir; pwd`
14 export STAT_CONFIG_PATH=$top_srcdir/config
19 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
20 echo "NOT cleaning $TEMPDIR"
55 DATA LIST LIST /x * y (a200).
57 1.2 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
59 0 ddddddddddddddddddddddddddddddd
63 SAVE OUTFILE='$TEMPDIR/com.sav' /COMPRESS .
65 GET FILE='$TEMPDIR/com.sav'.
70 if [ $? -ne 0 ] ; then no_result ; fi
73 activity="run program"
74 $SUPERVISOR $top_builddir/src/pspp --testing-mode -o raw-ascii $TESTFILE
75 if [ $? -ne 0 ] ; then fail ; fi
77 # Make sure the file really was compressed
78 activity="inspect system file"
79 dd if=$TEMPDIR/com.sav bs=1 skip=72 count=1 2> /dev/null | od > $TEMPDIR/file
80 if [ $? -ne 0 ] ; then no_result ; fi
82 activity="check compression byte"
83 diff $TEMPDIR/file - <<EOF
87 if [ $? -ne 0 ] ; then fail ; fi