3 # This program tests that system files can be read and written
4 # without the long name tables.
7 TEMPDIR=/tmp/pspp-tst-$$
8 TESTFILE=$TEMPDIR/`basename $0`.sps
10 # ensure that top_builddir are absolute
11 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
12 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
13 top_builddir=`cd $top_builddir; pwd`
14 PSPP=$top_builddir/src/ui/terminal/pspp
16 # ensure that top_srcdir is absolute
17 top_srcdir=`cd $top_srcdir; pwd`
19 STAT_CONFIG_PATH=$top_srcdir/config
20 export STAT_CONFIG_PATH
57 activity="create program"
59 DATA LIST LIST NOTABLE / X * variable001 * variable002 * variable003 * .
71 SAVE /OUTFILE='$TEMPDIR/foo.sav'
75 GET /FILE='$TEMPDIR/foo.sav'.
80 if [ $? -ne 0 ] ; then no_result ; fi
82 activity="run program"
83 $SUPERVISOR $PSPP -o raw-ascii $TESTFILE
84 if [ $? -ne 0 ] ; then no_result ; fi
86 activity="check file exists"
87 ls -l $TEMPDIR/foo.sav > /dev/null
88 if [ $? -ne 0 ] ; then no_result ; fi
90 # Ensure that the written file has no long name table
91 activity="check sysfile type"
92 grep 'X=X' $TEMPDIR/foo.sav
93 if [ $? -eq 0 ] ; then fail ; fi
95 activity="compare output"
96 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
97 diff -b -w $TEMPDIR/pspp.list - << EOF
98 X VARIABLE VARIAB_A VARIAB_B
99 -------- -------- -------- --------
109 if [ $? -ne 0 ] ; then fail ; fi