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
14 STAT_CONFIG_PATH=$top_srcdir/config
15 export STAT_CONFIG_PATH
52 activity="create program"
53 cat > $TEMPDIR/vectors.stat <<EOF
54 DATA LIST /N1 TO N5 1-5.
55 MISSING VALUES N1 TO N5 (3 THRU 5, 1).
64 COMPUTE X(I)=N(I) + 1.
71 if [ $? -ne 0 ] ; then no_result ; fi
73 activity="run program"
74 $SUPERVISOR $PSPP -o raw-ascii $TEMPDIR/vectors.stat > $TEMPDIR/vectors.err 2> $TEMPDIR/vectors.out
75 if [ $? -ne 0 ] ; then fail ; fi
77 activity="compare results"
78 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
79 diff -b $TEMPDIR/pspp.list - <<EOF
80 1.1 DATA LIST. Reading 1 record from INLINE.
81 +--------+------+-------+------+
82 |Variable|Record|Columns|Format|
83 #========#======#=======#======#
89 +--------+------+-------+------+
90 N1 N2 N3 N4 N5 X1 X2 X3 X4 X5 I
91 -- -- -- -- -- -- -- -- -- -- --
93 6 7 8 9 . 7 8 9 10 . 5
96 if [ $? -ne 0 ] ; then no_result ; fi
99 if [ $? -ne 0 ] ; then fail ; fi