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