3 # This program tests for bug #22037, which caused CROSSTABS to crash.
5 TEMPDIR=/tmp/pspp-tst-$$
6 TESTFILE=$TEMPDIR/`basename $0`.sps
8 # ensure that top_builddir are absolute
9 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
10 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
11 top_builddir=`cd $top_builddir; pwd`
12 PSPP=$top_builddir/src/ui/terminal/pspp
14 # ensure that top_srcdir is absolute
15 top_srcdir=`cd $top_srcdir; pwd`
17 STAT_CONFIG_PATH=$top_srcdir/config
18 export STAT_CONFIG_PATH
25 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
26 echo "NOT cleaning $TEMPDIR"
61 activity="create program"
63 data list list /x * y (a18).
74 CROSSTABS /TABLES = x BY y.
76 if [ $? -ne 0 ] ; then no_result ; fi
78 $SUPERVISOR $PSPP --testing-mode $TESTFILE > /dev/null
79 if [ $? -ne 0 ] ; then no_result ; fi
81 diff -c $TEMPDIR/pspp.csv - << EOF
82 Table: Reading free-form data from INLINE.
87 "$TEMPDIR/crosstabs-crash2.sh.sps:4: warning: BEGIN DATA: Missing value(s) for all variables from x onward. These will be filled with the system-missing value or blanks, as appropriate."
89 "$TEMPDIR/crosstabs-crash2.sh.sps:6: warning: BEGIN DATA: Missing value(s) for all variables from x onward. These will be filled with the system-missing value or blanks, as appropriate."
93 ,Valid,,Missing,,Total,
94 ,N,Percent,N,Percent,N,Percent
95 x * y,4,66.7%,2,33.3%,6,100.0%
99 x,one unity ,three lots ,two duality ,zero none ,Total
100 1.00,1.0,.0,.0,1.0,2.0
101 2.00,.0,.0,1.0,.0,1.0
102 3.00,.0,1.0,.0,.0,1.0
103 Total,1.0,1.0,1.0,1.0,4.0
105 if [ $? -ne 0 ] ; then fail ; fi