3 # This program tests the VECTOR 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 prog"
63 cat > $TEMPDIR/vector.stat <<EOF
64 data list notable/x 1.
68 data list notable/x 1.
69 vector #vec(4, comma10.2).
74 data list/x5 x2 x3 x1 x4 1-5.
78 data list notable/u w x y z 1-5.
84 if [ $? -ne 0 ] ; then no_result ; fi
86 activity="run program"
87 $SUPERVISOR $PSPP -o pspp.csv -e $TEMPDIR/stdout $TEMPDIR/vector.stat
88 if [ $? -ne 0 ] ; then no_result ; fi
90 activity="compare stdout"
91 perl -pi -e 's/^\s*$//g' $TEMPDIR/stdout
92 diff -b $TEMPDIR/stdout - <<EOF
94 if [ $? -ne 0 ] ; then fail ; fi
96 activity="compare results"
97 diff -c $TEMPDIR/pspp.csv - <<EOF
98 Vector,Position,Variable,Print Format
104 Vector,Position,Variable,Print Format
105 #vec,1,#vec1,COMMA10.2
110 Table: Reading 1 record from INLINE.
111 Variable,Record,Columns,Format
118 Vector,Position,Variable,Print Format
125 Vector,Position,Variable,Print Format
139 if [ $? -ne 0 ] ; then fail ; fi