3 # This program tests that the descriptives command actually works
5 TEMPDIR=/tmp/pspp-tst-$$
7 # ensure that top_builddir are absolute
8 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
9 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
10 top_builddir=`cd $top_builddir; pwd`
11 PSPP=$top_builddir/src/ui/terminal/pspp
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
56 activity="create program"
57 cat > $TEMPDIR/descript.stat <<EOF
58 title 'Test DESCRIPTIVES procedure'.
60 data list / V0 to V16 1-17.
74 descript all/stat=all/format=serial.
77 if [ $? -ne 0 ] ; then no_result ; fi
80 activity="run program"
81 $SUPERVISOR $PSPP -o raw-ascii $TEMPDIR/descript.stat
82 if [ $? -ne 0 ] ; then no_result ; fi
84 activity="compare output"
85 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
86 diff -b $TEMPDIR/pspp.list - <<EOF
87 1.1 DATA LIST. Reading 1 record from INLINE.
88 +--------+------+-------+------+
89 |Variable|Record|Columns|Format|
90 #========#======#=======#======#
100 |V9 | 1| 10- 10|F1.0 |
101 |V10 | 1| 11- 11|F1.0 |
102 |V11 | 1| 12- 12|F1.0 |
103 |V12 | 1| 13- 13|F1.0 |
104 |V13 | 1| 14- 14|F1.0 |
105 |V14 | 1| 15- 15|F1.0 |
106 |V15 | 1| 16- 16|F1.0 |
107 |V16 | 1| 17- 17|F1.0 |
108 +--------+------+-------+------+
109 2.1 DESCRIPTIVES. Valid cases = 10; cases with missing value(s) = 0.
110 +--------#-------+---------+-----+--------+-------+--------+--------+--------+--------+--------+-----+-------+-------+------+
111 |Variable#Valid N|Missing N| Mean|S E Mean|Std Dev|Variance|Kurtosis|S E Kurt|Skewness|S E Skew|Range|Minimum|Maximum| Sum |
112 #========#=======#=========#=====#========#=======#========#========#========#========#========#=====#=======#=======#======#
113 |V0 # 10| 0|3.800| .841| 2.658| 7.067| -.035| 1.334| .889| .687|8.000| 1.000| 9.000|38.000|
114 |V1 # 10| 0|4.600| .957| 3.026| 9.156| -1.386| 1.334| -.032| .687|9.000| .000| 9.000|46.000|
115 |V2 # 10| 0|4.100| 1.159| 3.665| 13.433| -2.019| 1.334| .476| .687|8.000| 1.000| 9.000|41.000|
116 |V3 # 10| 0|4.100| .875| 2.767| 7.656| -2.049| 1.334| .422| .687|7.000| 1.000| 8.000|41.000|
117 |V4 # 10| 0|7.000| .471| 1.491| 2.222| 7.152| 1.334| -2.516| .687|5.000| 3.000| 8.000|70.000|
118 |V5 # 10| 0|4.900| 1.027| 3.247| 10.544| -1.401| 1.334| -.205| .687|9.000| .000| 9.000|49.000|
119 |V6 # 10| 0|5.900| .795| 2.514| 6.322| -.290| 1.334| -.960| .687|7.000| 1.000| 8.000|59.000|
120 |V7 # 10| 0|4.700| 1.096| 3.466| 12.011| -1.993| 1.334| -.165| .687|9.000| .000| 9.000|47.000|
121 |V8 # 10| 0|4.100| 1.100| 3.479| 12.100| -1.928| 1.334| .371| .687|9.000| .000| 9.000|41.000|
122 |V9 # 10| 0|4.300| .870| 2.751| 7.567| -.875| 1.334| .730| .687|8.000| 1.000| 9.000|43.000|
123 |V10 # 10| 0|5.500| .847| 2.677| 7.167| -1.842| 1.334| -.326| .687|7.000| 2.000| 9.000|55.000|
124 |V11 # 10| 0|6.500| .778| 2.461| 6.056| -1.276| 1.334| -.895| .687|6.000| 3.000| 9.000|65.000|
125 |V12 # 10| 0|7.900| .605| 1.912| 3.656| 5.241| 1.334| -2.208| .687|6.000| 3.000| 9.000|79.000|
126 |V13 # 10| 0|4.300| .989| 3.129| 9.789| -1.248| 1.334| .333| .687|9.000| .000| 9.000|43.000|
127 |V14 # 10| 0|3.600| 1.013| 3.204| 10.267| -.961| 1.334| .809| .687|9.000| .000| 9.000|36.000|
128 |V15 # 10| 0|3.700| .920| 2.908| 8.456| -1.352| 1.334| .710| .687|7.000| 1.000| 8.000|37.000|
129 |V16 # 10| 0|6.400| .909| 2.875| 8.267| -1.142| 1.334| -.923| .687|7.000| 2.000| 9.000|64.000|
130 +--------#-------+---------+-----+--------+-------+--------+--------+--------+--------+--------+-----+-------+-------+------+
132 if [ $? -ne 0 ] ; then fail ; fi