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 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
82 diff -b -w $TEMPDIR/pspp.list - << EOF
83 1.1 DATA LIST. Reading free-form data from INLINE.
90 $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.
91 $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.
92 2.1 CROSSTABS. Summary.
93 #===============#=====================================================#
95 # #-----------------+-----------------+-----------------#
96 # # Valid | Missing | Total #
97 # #--------+--------+--------+--------+--------+--------#
98 # # N| Percent| N| Percent| N| Percent#
99 #---------------#--------+--------+--------+--------+--------+--------#
100 #x * y # 4| 66.7%| 2| 33.3%| 6| 100.0%#
101 #===============#========#========#========#========#========#========#
102 2.2 CROSSTABS. x by y [count].
103 #===============#===================================#========#
105 # #--------+--------+--------+--------+ #
106 # x#one unit|three lo|two dual|zero non| Total #
107 #---------------#--------+--------+--------+--------+--------#
108 # 1.00# 1.0| .0| .0| 1.0| 2.0#
109 # 2.00# .0| .0| 1.0| .0| 1.0#
110 # 3.00# .0| 1.0| .0| .0| 1.0#
111 #Total # 1.0| 1.0| 1.0| 1.0| 4.0#
112 #===============#========#========#========#========#========#
114 if [ $? -ne 0 ] ; then fail ; fi