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 export STAT_CONFIG_PATH=$top_srcdir/config
18 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then return ; fi
50 activity="create program"
51 cat > $TESTFILE << EOF
52 data list file='$top_srcdir/tests/weighting.data'/AVAR 1-5 BVAR 6-10.
55 descriptives AVAR /statistics all /format serial.
56 frequencies AVAR /statistics all /format condense.
59 if [ $? -ne 0 ] ; then no_result ; fi
62 activity="run program"
63 $SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TESTFILE
64 if [ $? -ne 0 ] ; then no_result ; fi
66 activity="compare results"
67 diff -B -b $TEMPDIR/pspp.list - <<EOF
68 1.1 DATA LIST. Reading 1 record from file $top_srcdir/tests/weighting.data.
69 +--------+------+-------+------+
70 |Variable|Record|Columns|Format|
71 #========#======#=======#======#
72 |AVAR | 1| 1- 5|F5.0 |
73 |BVAR | 1| 6- 10|F5.0 |
74 +--------+------+-------+------+
76 2.1 DESCRIPTIVES. Valid cases = 730; cases with missing value(s) = 0.
77 +--------#-------+---------+------+--------+-------+--------+--------+--------+--------+--------+------+-------+-------+---------+
78 |Variable#Valid N|Missing N| Mean |S E Mean|Std Dev|Variance|Kurtosis|S E Kurt|Skewness|S E Skew| Range|Minimum|Maximum| Sum |
79 #========#=======#=========#======#========#=======#========#========#========#========#========#======#=======#=======#=========#
80 |AVAR # 730| 0|31.515| .405| 10.937| 119.608| 2.411| .181| 1.345| .090|76.000| 18.000| 94.000|23006.000|
81 +--------#-------+---------+------+--------+-------+--------+--------+--------+--------+--------+------+-------+-------+---------+
83 3.1 FREQUENCIES. AVAR:
84 +--------+--------+---+---+
86 | Value | Freq |Pct|Pct|
87 #========#========#===#===#
140 +--------+--------+---+---+
142 +-----------------+---------+
159 +-----------------+---------+
161 if [ $? -ne 0 ] ; then fail ; fi