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