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
12 # ensure that top_builddir are absolute
13 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
14 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
15 top_builddir=`cd $top_builddir; pwd`
16 PSPP=$top_builddir/src/ui/terminal/pspp
18 # ensure that top_srcdir is absolute
19 top_srcdir=`cd $top_srcdir; pwd`
21 STAT_CONFIG_PATH=$top_srcdir/config
22 export STAT_CONFIG_PATH
27 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
28 echo "NOT cleaning $TEMPDIR"
63 activity="delete data"
64 rm -f $TEMPDIR/large.dat
65 if [ $? -ne 0 ] ; then no_result ; fi
67 printf "Creating input data. Please wait"
68 activity="create data"
69 $PERL -e 'for ($i=0; $i<100000; $i++) { print "AB12\n" };
70 for ($i=0; $i<100000; $i++) { print "AB04\n" };' > $TEMPDIR/large.dat
71 if [ $? -ne 0 ] ; then no_result ; fi
74 activity="create program"
76 DATA LIST FILE='$TEMPDIR/large.dat' /S 1-2 (A) X 3 .
79 AGGREGATE OUTFILE=* /BREAK=X /A=N.
84 if [ $? -ne 0 ] ; then no_result ; fi
86 activity="run program"
87 $SUPERVISOR $PSPP --testing-mode -e /dev/null $TESTFILE
88 if [ $? -ne 0 ] ; then fail ; fi
90 activity="appending to data"
91 # Put another 50,000 cases into large.dat
92 $PERL -e 'for ($i=0; $i<25000; $i++) { print "AB04\nAB12\n" };' >> $TEMPDIR/large.dat
93 if [ $? -ne 0 ] ; then no_result ; fi
95 activity="run program"
96 $SUPERVISOR $PSPP --testing-mode -e /dev/null $TESTFILE
97 if [ $? -ne 0 ] ; then fail ; fi