3 # This program tests for a bug in which examine didn't
4 # count missing values.
6 TEMPDIR=/tmp/pspp-tst-$$
7 TESTFILE=$TEMPDIR/`basename $0`.sps
9 # ensure that top_srcdir and top_builddir are absolute
10 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
11 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
12 top_srcdir=`cd $top_srcdir; pwd`
13 top_builddir=`cd $top_builddir; pwd`
15 PSPP=$top_builddir/src/ui/terminal/pspp$EXEEXT
17 STAT_CONFIG_PATH=$top_srcdir/config
18 export STAT_CONFIG_PATH
26 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
27 echo "NOT cleaning $TEMPDIR"
62 activity="create program 1"
63 cat > $TESTFILE << EOF
64 DATA LIST LIST /x * y *.
77 if [ $? -ne 0 ] ; then no_result ; fi
80 activity="run program 1"
81 $SUPERVISOR $PSPP -o pspp.csv $TESTFILE
82 if [ $? -ne 0 ] ; then no_result ; fi
84 activity="compare results"
85 diff -c $TEMPDIR/pspp.csv - <<EOF
86 Table: Reading free-form data from INLINE.
91 Table: Case Processing Summary
93 ,Valid,,Missing,,Total,
94 ,N,Percent,N,Percent,N,Percent
95 x,6,85.7143%,1,14.2857%,7,100%
97 Table: Case Processing Summary
99 ,,Valid,,Missing,,Total,
100 ,y,N,Percent,N,Percent,N,Percent
101 x,1.00,4,100%,0,0%,4,100%
102 ,2.00,2,66.6667%,1,33.3333%,3,100%
104 if [ $? -ne 0 ] ; then fail ; fi
107 #Make sure this doesn't interfere with percentiles operation.
109 activity="create program 2"
110 cat > $TESTFILE << EOF
118 MISSING VALUE X (99).
121 /PERCENTILES=HAVERAGE.
125 if [ $? -ne 0 ] ; then no_result ; fi
128 activity="run program 2"
129 $SUPERVISOR $PSPP -o pspp.csv $TESTFILE
130 if [ $? -ne 0 ] ; then fail ; fi