3 # This program tests the WEIGHT command
5 TEMPDIR=/tmp/pspp-tst-$$
6 TESTFILE=$TEMPDIR/`basename $0`.sps
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"
62 activity="create program"
63 cat > $TESTFILE << EOF
64 data list file='$top_srcdir/tests/weighting.data'/AVAR 1-5 BVAR 6-10.
67 descriptives AVAR /statistics all /format serial.
68 frequencies AVAR /statistics all /format condense.
71 if [ $? -ne 0 ] ; then no_result ; fi
74 activity="run program"
75 $SUPERVISOR $PSPP --testing-mode $TESTFILE
76 if [ $? -ne 0 ] ; then no_result ; fi
78 activity="compare results"
79 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
80 diff -b $TEMPDIR/pspp.list - <<EOF
81 1.1 DATA LIST. Reading 1 record from "$top_srcdir/tests/weighting.data".
82 +--------+------+-------+------+
83 |Variable|Record|Columns|Format|
84 #========#======#=======#======#
85 |AVAR | 1| 1- 5|F5.0 |
86 |BVAR | 1| 6- 10|F5.0 |
87 +--------+------+-------+------+
88 2.1 DESCRIPTIVES. Valid cases = 730; cases with missing value(s) = 0.
89 +--------#-------+---------+------+--------+-------+--------+--------+--------+--------+--------+------+-------+-------+---------+
90 |Variable#Valid N|Missing N| Mean |S E Mean|Std Dev|Variance|Kurtosis|S E Kurt|Skewness|S E Skew| Range|Minimum|Maximum| Sum |
91 #========#=======#=========#======#========#=======#========#========#========#========#========#======#=======#=======#=========#
92 |AVAR # 730| 0|31.515| .405| 10.937| 119.608| 2.411| .181| 1.345| .090|76.000| 18.000| 94.000|23006.000|
93 +--------#-------+---------+------+--------+-------+--------+--------+--------+--------+--------+------+-------+-------+---------+
95 +--------+--------+---+---+
97 | Value | Freq |Pct|Pct|
98 #========#========#===#===#
151 +--------+--------+---+---+
152 +-----------------------+---------+
168 |Percentiles 50 (Median)| 28.500|
169 +-----------------------+---------+
171 if [ $? -ne 0 ] ; then fail ; fi