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 return ; fi
59 activity="create program"
60 cat > $TESTFILE << EOF
61 data list file='$top_srcdir/tests/weighting.data'/AVAR 1-5 BVAR 6-10.
64 descriptives AVAR /statistics all /format serial.
65 frequencies AVAR /statistics all /format condense.
68 if [ $? -ne 0 ] ; then no_result ; fi
71 activity="run program"
72 $SUPERVISOR $PSPP --testing-mode -o raw-ascii $TESTFILE
73 if [ $? -ne 0 ] ; then no_result ; fi
75 activity="compare results"
76 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
77 diff -b $TEMPDIR/pspp.list - <<EOF
78 1.1 DATA LIST. Reading 1 record from "$top_srcdir/tests/weighting.data".
79 +--------+------+-------+------+
80 |Variable|Record|Columns|Format|
81 #========#======#=======#======#
82 |AVAR | 1| 1- 5|F5.0 |
83 |BVAR | 1| 6- 10|F5.0 |
84 +--------+------+-------+------+
85 2.1 DESCRIPTIVES. Valid cases = 730; cases with missing value(s) = 0.
86 +--------#-------+---------+------+--------+-------+--------+--------+--------+--------+--------+------+-------+-------+---------+
87 |Variable#Valid N|Missing N| Mean |S E Mean|Std Dev|Variance|Kurtosis|S E Kurt|Skewness|S E Skew| Range|Minimum|Maximum| Sum |
88 #========#=======#=========#======#========#=======#========#========#========#========#========#======#=======#=======#=========#
89 |AVAR # 730| 0|31.515| .405| 10.937| 119.608| 2.411| .181| 1.345| .090|76.000| 18.000| 94.000|23006.000|
90 +--------#-------+---------+------+--------+-------+--------+--------+--------+--------+--------+------+-------+-------+---------+
92 +--------+--------+---+---+
94 | Value | Freq |Pct|Pct|
95 #========#========#===#===#
148 +--------+--------+---+---+
149 +-----------------+---------+
166 +-----------------+---------+
168 if [ $? -ne 0 ] ; then fail ; fi