3 # This program tests for a bug which caused a crash when
4 # very large files are presented.
7 TEMPDIR=/tmp/pspp-tst-$$
8 TESTFILE=$TEMPDIR/`basename $0`.sps
9 TESTFILE=$TEMPDIR/`basename $0`.sps
11 # ensure that top_builddir are absolute
12 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
13 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
14 top_builddir=`cd $top_builddir; pwd`
15 PSPP=$top_builddir/src/ui/terminal/pspp
17 # ensure that top_srcdir is absolute
18 top_srcdir=`cd $top_srcdir; pwd`
20 STAT_CONFIG_PATH=$top_srcdir/config
21 export STAT_CONFIG_PATH
58 activity="delete data"
59 rm -f $TEMPDIR/large.dat
60 if [ $? -ne 0 ] ; then no_result ; fi
62 printf "Creating input data. Please wait"
63 activity="create data"
64 $PERL -e 'for ($i=0; $i<100000; $i++) { print "AB12\n" };
65 for ($i=0; $i<100000; $i++) { print "AB04\n" };' > $TEMPDIR/large.dat
66 if [ $? -ne 0 ] ; then no_result ; fi
69 activity="create program"
71 DATA LIST FILE='$TEMPDIR/large.dat' /S 1-2 (A) X 3 .
74 AGGREGATE OUTFILE=* /BREAK=X /A=N.
79 if [ $? -ne 0 ] ; then no_result ; fi
81 activity="run program"
82 $SUPERVISOR $PSPP -o raw-ascii -e /dev/null $TESTFILE
83 if [ $? -ne 0 ] ; then fail ; fi
85 activity="appending to data"
86 # Put another 50,000 cases into large.dat
87 $PERL -e 'for ($i=0; $i<25000; $i++) { print "AB04\nAB12\n" };' >> $TEMPDIR/large.dat
88 if [ $? -ne 0 ] ; then no_result ; fi
90 activity="run program"
91 $SUPERVISOR $PSPP -o raw-ascii -e /dev/null $TESTFILE
92 if [ $? -ne 0 ] ; then fail ; fi