3 # Tests calculation of percentiles with the
4 # COMPATIBLE 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`
13 # ensure that top_srcdir is absolute
14 top_srcdir=`cd $top_srcdir; pwd`
16 STAT_CONFIG_PATH=$top_srcdir/config
17 export STAT_CONFIG_PATH
58 activity="create program $i"
59 cat > $TEMPDIR/prog.sps <<EOF
60 DATA LIST LIST notable /X * .
72 /PERCENTILES = 0 25 50 75 100
75 if [ $? -ne 0 ] ; then no_result; fi
77 activity="run program $i"
78 $SUPERVISOR $top_builddir/src/pspp -o raw-ascii $TEMPDIR/prog.sps
79 if [ $? -ne 0 ] ; then no_result ; fi
81 activity="compare output $i"
82 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
83 diff -b $TEMPDIR/pspp.list - <<EOF
85 +-----------+--------+---------+--------+--------+--------+
86 | | | | | Valid | Cum |
87 |Value Label| Value |Frequency| Percent| Percent| Percent|
88 #===========#========#=========#========#========#========#
89 | | 1.00| 1| 20.0| 20.0| 20.0|
90 | | 2.00| 1| 20.0| 20.0| 40.0|
91 | | 3.00| 1| 20.0| 20.0| 60.0|
92 | | 4.00| 1| 20.0| 20.0| 80.0|
93 | | 5.00| 1| 20.0| 20.0| 100.0|
94 #===========#========#=========#========#========#========#
95 | Total| 5| 100.0| 100.0| |
96 +--------------------+---------+--------+--------+--------+
97 +-------------------+-----+
104 |Percentiles 0 |1.000|
109 +-------------------+-----+
111 if [ $? -ne 0 ] ; then fail ; fi