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
57 activity="create program"
59 data list list /x * y (a18).
70 CROSSTABS /TABLES = x BY y.
72 if [ $? -ne 0 ] ; then no_result ; fi
74 $SUPERVISOR $PSPP --testing-mode $TESTFILE > /dev/null
75 if [ $? -ne 0 ] ; then no_result ; fi
77 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
78 diff -b -w $TEMPDIR/pspp.list - << EOF
79 1.1 DATA LIST. Reading free-form data from INLINE.
86 $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.
87 $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.
88 2.1 CROSSTABS. Summary.
89 #===============#=====================================================#
91 # #-----------------+-----------------+-----------------#
92 # # Valid | Missing | Total #
93 # #--------+--------+--------+--------+--------+--------#
94 # # N| Percent| N| Percent| N| Percent#
95 #---------------#--------+--------+--------+--------+--------+--------#
96 #x * y # 4| 66.7%| 2| 33.3%| 6| 100.0%#
97 #===============#========#========#========#========#========#========#
98 2.2 CROSSTABS. x by y [count].
99 #===============#===================================#========#
101 # #--------+--------+--------+--------+ #
102 # x#one unit|three lo|two dual|zero non| Total #
103 #---------------#--------+--------+--------+--------+--------#
104 # 1.00# 1.0| .0| .0| 1.0| 2.0#
105 # 2.00# .0| .0| 1.0| .0| 1.0#
106 # 3.00# .0| 1.0| .0| .0| 1.0#
107 #Total # 1.0%| 1.0%| 1.0%| 1.0%| 4.0%#
108 #===============#========#========#========#========#========#
110 if [ $? -ne 0 ] ; then fail ; fi