3 # Tests calculation of percentiles with the
4 # ENHANCED algorithm set.
6 TEMPDIR=/tmp/pspp-tst-$$
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
26 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
27 echo "NOT cleaning $TEMPDIR"
65 activity="create program $i"
66 cat > $TEMPDIR/prog.sps <<EOF
67 DATA LIST LIST notable /X * .
78 /PERCENTILES = 0 25 50 75 100
81 if [ $? -ne 0 ] ; then no_result; fi
83 activity="run program $i"
84 $SUPERVISOR $PSPP --testing-mode $TEMPDIR/prog.sps
85 if [ $? -ne 0 ] ; then no_result ; fi
87 activity="compare output $i"
88 diff -c $TEMPDIR/pspp.csv - <<EOF
90 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
91 ,1.00,1,20.00,20.00,20.00
92 ,2.00,1,20.00,20.00,40.00
93 ,3.00,1,20.00,20.00,60.00
94 ,4.00,1,20.00,20.00,80.00
95 ,5.00,1,20.00,20.00,100.00
110 if [ $? -ne 0 ] ; then fail ; fi
116 activity="create program $i"
117 cat > $TEMPDIR/prog.sps <<EOF
118 DATA LIST LIST notable /X * F *.
133 /PERCENTILES = 0 25 50 75 100
136 if [ $? -ne 0 ] ; then no_result; fi
139 activity="run program $i"
140 $SUPERVISOR $PSPP --testing-mode $TEMPDIR/prog.sps
141 if [ $? -ne 0 ] ; then no_result ; fi
143 activity="compare output $i"
144 diff -c $TEMPDIR/pspp.csv - <<EOF
146 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
147 ,1.00,2.00,20.00,20.00,20.00
148 ,2.00,2.00,20.00,20.00,40.00
149 ,3.00,2.00,20.00,20.00,60.00
150 ,4.00,2.00,20.00,20.00,80.00
151 ,5.00,2.00,20.00,20.00,100.00
152 Total,,10.00,100.0,100.0,
166 if [ $? -ne 0 ] ; then fail ; fi
172 activity="create program $i"
173 cat > $TEMPDIR/prog.sps <<EOF
174 DATA LIST LIST notable /X * F *.
187 /PERCENTILES = 0 25 50 75 100
190 if [ $? -ne 0 ] ; then no_result; fi
193 activity="run program $i"
194 $SUPERVISOR $PSPP --testing-mode $TEMPDIR/prog.sps
195 if [ $? -ne 0 ] ; then no_result ; fi
197 activity="compare output $i"
198 diff -c $TEMPDIR/pspp.csv - <<EOF
200 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
201 ,1.00,1.00,16.67,16.67,16.67
202 ,3.00,2.00,33.33,33.33,50.00
203 ,4.00,1.00,16.67,16.67,66.67
204 ,5.00,2.00,33.33,33.33,100.00
205 Total,,6.00,100.0,100.0,
219 if [ $? -ne 0 ] ; then fail ; fi
223 activity="create program $i"
224 cat > $TEMPDIR/prog.sps <<EOF
225 DATA LIST LIST notable /X * F *.
235 MISSING VALUE x (99.0) .
240 /PERCENTILES = 0 25 50 75 100
243 if [ $? -ne 0 ] ; then no_result; fi
246 activity="run program $i"
247 $SUPERVISOR $PSPP --testing-mode $TEMPDIR/prog.sps
248 if [ $? -ne 0 ] ; then no_result ; fi
250 activity="compare output $i"
251 diff -c $TEMPDIR/pspp.csv - <<EOF
253 Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
254 ,1.00,1.00,10.00,16.67,16.67
255 ,3.00,2.00,20.00,33.33,50.00
256 ,4.00,1.00,10.00,16.67,66.67
257 ,5.00,2.00,20.00,33.33,100.00
258 ,99.00,4.00,40.00,Missing,
259 Total,,10.00,100.0,100.0,
273 if [ $? -ne 0 ] ; then fail ; fi