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`
13 PSPP=$top_builddir/src/ui/terminal/pspp
15 STAT_CONFIG_PATH=$top_srcdir/config
16 export STAT_CONFIG_PATH
21 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
22 echo "NOT cleaning $TEMPDIR"
57 DATA LIST LIST /x * y (a200).
59 1.2 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
61 0 ddddddddddddddddddddddddddddddd
65 SAVE OUTFILE='$TEMPDIR/com.sav' /COMPRESS .
67 GET FILE='$TEMPDIR/com.sav'.
72 if [ $? -ne 0 ] ; then no_result ; fi
75 activity="run program"
76 $SUPERVISOR $PSPP --testing-mode $TESTFILE
77 if [ $? -ne 0 ] ; then fail ; fi
79 # Make sure the file really was compressed
80 activity="inspect system file"
81 dd if=$TEMPDIR/com.sav bs=1 skip=72 count=4 2> /dev/null | od > $TEMPDIR/file
82 if [ $? -ne 0 ] ; then no_result ; fi
84 activity="check compression setting"
86 diff -b $TEMPDIR/file - > /dev/null <<EOF
90 if [ $? -ne 0 ] ; then pass ; fi
92 diff -b $TEMPDIR/file - > /dev/null <<EOF
96 if [ $? -ne 0 ] ; then pass ; fi