3 # This program tests the WEIGHT command
5 TEMPDIR=/tmp/pspp-tst-$$
6 TESTFILE=$TEMPDIR/`basename $0`.sps
10 # ensure that top_srcdir is absolute
11 cd $top_srcdir; top_srcdir=`pwd`
13 STAT_CONFIG_PATH=$top_srcdir/config
14 export STAT_CONFIG_PATH
19 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then return ; fi
52 activity="create program"
53 cat > $TESTFILE << EOF
54 data list file='$top_srcdir/tests/weighting.data'/AVAR 1-5 BVAR 6-10.
57 descriptives AVAR /statistics all /format serial.
58 frequencies AVAR /statistics all /format condense.
61 if [ $? -ne 0 ] ; then no_result ; fi
64 activity="run program"
65 $SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TESTFILE
66 if [ $? -ne 0 ] ; then no_result ; fi
68 activity="compare results"
69 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
70 diff -b $TEMPDIR/pspp.list - <<EOF
71 1.1 DATA LIST. Reading 1 record from file $top_srcdir/tests/weighting.data.
72 +--------+------+-------+------+
73 |Variable|Record|Columns|Format|
74 #========#======#=======#======#
75 |AVAR | 1| 1- 5|F5.0 |
76 |BVAR | 1| 6- 10|F5.0 |
77 +--------+------+-------+------+
78 2.1 DESCRIPTIVES. Valid cases = 730; cases with missing value(s) = 0.
79 +--------#-------+---------+------+--------+-------+--------+--------+--------+--------+--------+------+-------+-------+---------+
80 |Variable#Valid N|Missing N| Mean |S E Mean|Std Dev|Variance|Kurtosis|S E Kurt|Skewness|S E Skew| Range|Minimum|Maximum| Sum |
81 #========#=======#=========#======#========#=======#========#========#========#========#========#======#=======#=======#=========#
82 |AVAR # 730| 0|31.515| .405| 10.937| 119.608| 2.411| .181| 1.345| .090|76.000| 18.000| 94.000|23006.000|
83 +--------#-------+---------+------+--------+-------+--------+--------+--------+--------+--------+------+-------+-------+---------+
84 3.1 FREQUENCIES. AVAR:
85 +--------+--------+---+---+
87 | Value | Freq |Pct|Pct|
88 #========#========#===#===#
141 +--------+--------+---+---+
142 +-----------------+---------+
159 +-----------------+---------+
161 if [ $? -ne 0 ] ; then fail ; fi