3 # This program tests the PERCENTILES subcommand of the EXAMINE command.
4 # In particular it tests that it behaves properly when there are only
7 TEMPDIR=/tmp/pspp-tst-$$
8 TESTFILE=$TEMPDIR/`basename $0`.sps
10 # ensure that top_builddir are absolute
11 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
12 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
13 top_builddir=`cd $top_builddir; pwd`
14 PSPP=$top_builddir/src/ui/terminal/pspp
16 # ensure that top_srcdir is absolute
17 top_srcdir=`cd $top_srcdir; pwd`
19 STAT_CONFIG_PATH=$top_srcdir/config
20 export STAT_CONFIG_PATH
28 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
29 echo "NOT cleaning $TEMPDIR"
64 activity="create program"
74 /PERCENTILES=HAVERAGE.
77 /PERCENTILES=WAVERAGE.
83 /PERCENTILES=EMPIRICAL.
86 /PERCENTILES=AEMPIRICAL.
88 if [ $? -ne 0 ] ; then no_result ; fi
90 activity="run program"
91 $SUPERVISOR $PSPP --testing-mode $TESTFILE
92 if [ $? -ne 0 ] ; then no_result ; fi
95 activity="compare results"
96 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
97 diff -b $TEMPDIR/pspp.list - << EOF
98 1.1 DATA LIST. Reading free-form data from INLINE.
104 2.1 EXAMINE. Case Processing Summary
105 #=#=============================#
107 # #---------+---------+---------#
108 # # Valid | Missing | Total #
109 # #-+-------+-+-------+-+-------#
110 # #N|Percent|N|Percent|N|Percent#
111 #=#=#=======#=#=======#=#=======#
112 #X#3| 100%|0| 0%|3| 100%#
113 #=#=#=======#=#=======#=#=======#
114 2.2 EXAMINE. Percentiles
115 #================#================================#
117 # #---+---+----+----+----+----+----#
118 # # 5 | 10| 25 | 50 | 75 | 90 | 95 #
119 #=#==============#===#===#====#====#====#====#====#
120 #X|HAverage #.40|.80|2.00|5.00|8.00|8.00|8.00#
121 # |Tukey's Hinges# | |3.50|5.00|6.50| | #
122 #=#==============#===#===#====#====#====#====#====#
123 3.1 EXAMINE. Case Processing Summary
124 #=#=============================#
126 # #---------+---------+---------#
127 # # Valid | Missing | Total #
128 # #-+-------+-+-------+-+-------#
129 # #N|Percent|N|Percent|N|Percent#
130 #=#=#=======#=#=======#=#=======#
131 #X#3| 100%|0| 0%|3| 100%#
132 #=#=#=======#=#=======#=#=======#
133 3.2 EXAMINE. Percentiles
134 #==================#================================#
136 # #---+---+----+----+----+----+----#
137 # # 5 | 10| 25 | 50 | 75 | 90 | 95 #
138 #=#================#===#===#====#====#====#====#====#
139 #X|Weighted Average#.30|.60|1.50|3.50|5.75|7.10|7.55#
140 # |Tukey's Hinges # | |3.50|5.00|6.50| | #
141 #=#================#===#===#====#====#====#====#====#
142 4.1 EXAMINE. Case Processing Summary
143 #=#=============================#
145 # #---------+---------+---------#
146 # # Valid | Missing | Total #
147 # #-+-------+-+-------+-+-------#
148 # #N|Percent|N|Percent|N|Percent#
149 #=#=#=======#=#=======#=#=======#
150 #X#3| 100%|0| 0%|3| 100%#
151 #=#=#=======#=#=======#=#=======#
152 4.2 EXAMINE. Percentiles
153 #================#================================#
155 # #---+---+----+----+----+----+----#
156 # # 5 | 10| 25 | 50 | 75 | 90 | 95 #
157 #=#==============#===#===#====#====#====#====#====#
158 #X|Rounded #.00|.00|2.00|5.00|5.00|8.00|8.00#
159 # |Tukey's Hinges# | |3.50|5.00|6.50| | #
160 #=#==============#===#===#====#====#====#====#====#
161 5.1 EXAMINE. Case Processing Summary
162 #=#=============================#
164 # #---------+---------+---------#
165 # # Valid | Missing | Total #
166 # #-+-------+-+-------+-+-------#
167 # #N|Percent|N|Percent|N|Percent#
168 #=#=#=======#=#=======#=#=======#
169 #X#3| 100%|0| 0%|3| 100%#
170 #=#=#=======#=#=======#=#=======#
171 5.2 EXAMINE. Percentiles
172 #================#==================================#
174 # #----+----+----+----+----+----+----#
175 # # 5 | 10 | 25 | 50 | 75 | 90 | 95 #
176 #=#==============#====#====#====#====#====#====#====#
177 #X|Empirical #2.00|2.00|2.00|5.00|8.00|8.00|8.00#
178 # |Tukey's Hinges# | |3.50|5.00|6.50| | #
179 #=#==============#====#====#====#====#====#====#====#
180 6.1 EXAMINE. Case Processing Summary
181 #=#=============================#
183 # #---------+---------+---------#
184 # # Valid | Missing | Total #
185 # #-+-------+-+-------+-+-------#
186 # #N|Percent|N|Percent|N|Percent#
187 #=#=#=======#=#=======#=#=======#
188 #X#3| 100%|0| 0%|3| 100%#
189 #=#=#=======#=#=======#=#=======#
190 6.2 EXAMINE. Percentiles
191 #==========================#==================================#
193 # #----+----+----+----+----+----+----#
194 # # 5 | 10 | 25 | 50 | 75 | 90 | 95 #
195 #=#========================#====#====#====#====#====#====#====#
196 #X|Empirical with averaging#2.00|2.00|2.00|5.00|8.00|8.00|8.00#
197 # |Tukey's Hinges # | |3.50|5.00|6.50| | #
198 #=#========================#====#====#====#====#====#====#====#
200 if [ $? -ne 0 ] ; then fail ; fi