3 # This program tests the count transformation
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`
13 # ensure that top_srcdir is absolute
14 top_srcdir=`cd $top_srcdir; pwd`
16 STAT_CONFIG_PATH=$top_srcdir/config
17 export STAT_CONFIG_PATH
55 title 'Test COUNT transformation'.
57 * we're going to count the 2s 4s and 1s in the data
58 data list /V1 to V2 1-4(a).
64 1104 ---- this is not '4', but '04' (v1 and v2 are string format )
68 count C=v1 to v2('2',' 4','1').
71 if [ $? -ne 0 ] ; then no_result ; fi
74 $SUPERVISOR $top_builddir/src/pspp -o raw-ascii $TESTFILE
75 if [ $? -ne 0 ] ; then no_result ; fi
78 activity="compare results"
79 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
80 diff -b $TEMPDIR/pspp.list - <<EOF
81 1.1 DATA LIST. Reading 1 record from INLINE.
82 +--------+------+-------+------+
83 |Variable|Record|Columns|Format|
84 #========#======#=======#======#
87 +--------+------+-------+------+
98 if [ $? -ne 0 ] ; then no_result ; fi