3 # This program tests use of vectors in expressions.
5 TEMPDIR=/tmp/pspp-tst-$$
7 # ensure that top_srcdir and top_builddir are absolute
8 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
9 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
10 top_srcdir=`cd $top_srcdir; pwd`
11 top_builddir=`cd $top_builddir; pwd`
12 PSPP=$top_builddir/src/ui/terminal/pspp$EXEEXT
14 STAT_CONFIG_PATH=$top_srcdir/config
15 export STAT_CONFIG_PATH
23 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
24 echo "NOT cleaning $TEMPDIR"
59 activity="create program"
60 cat > $TEMPDIR/vectors.stat <<EOF
61 DATA LIST /N1 TO N5 1-5.
62 MISSING VALUES N1 TO N5 (3 THRU 5, 1).
71 COMPUTE X(I)=N(I) + 1.
78 if [ $? -ne 0 ] ; then no_result ; fi
80 activity="run program"
81 $SUPERVISOR $PSPP -o pspp.csv $TEMPDIR/vectors.stat > $TEMPDIR/vectors.err 2> $TEMPDIR/vectors.out
82 if [ $? -ne 0 ] ; then fail ; fi
84 activity="compare results"
85 diff -c $TEMPDIR/pspp.csv - <<EOF
86 Table: Reading 1 record from INLINE.
87 Variable,Record,Columns,Format
95 N1,N2,N3,N4,N5,X1,X2,X3,X4,X5,I
96 1,2,3,4,5,.,3,.,.,.,5
97 6,7,8,9,.,7,8,9,10,.,5
100 if [ $? -ne 0 ] ; then no_result ; fi
103 if [ $? -ne 0 ] ; then fail ; fi