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`
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 * .
79 /PERCENTILES = 0 25 50 75 100
82 if [ $? -ne 0 ] ; then no_result; fi
84 activity="run program $i"
85 $SUPERVISOR $PSPP --testing-mode $TEMPDIR/prog.sps
86 if [ $? -ne 0 ] ; then no_result ; fi
88 activity="compare output $i"
89 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
90 diff -b $TEMPDIR/pspp.list - <<EOF
92 +-----------+--------+---------+--------+-------------+-----------+
93 |Value Label| Value |Frequency| Percent|Valid Percent|Cum Percent|
94 #===========#========#=========#========#=============#===========#
95 | | 1.00| 1| 20.00| 20.00| 20.00|
96 | | 2.00| 1| 20.00| 20.00| 40.00|
97 | | 3.00| 1| 20.00| 20.00| 60.00|
98 | | 4.00| 1| 20.00| 20.00| 80.00|
99 | | 5.00| 1| 20.00| 20.00| 100.00|
100 #===========#========#=========#========#=============#===========#
101 | Total| 5| 100.0| 100.0| |
102 +--------------------+---------+--------+-------------+-----------+
103 +-----------------------+----+
110 |Percentiles 0 |1.00|
115 +-----------------------+----+
117 if [ $? -ne 0 ] ; then fail ; fi