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
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 --testing-mode $TEMPDIR/vectors.stat > $TEMPDIR/vectors.err 2> $TEMPDIR/vectors.out
82 if [ $? -ne 0 ] ; then fail ; fi
84 activity="compare results"
85 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
86 diff -b $TEMPDIR/pspp.list - <<EOF
87 1.1 DATA LIST. Reading 1 record from INLINE.
88 +--------+------+-------+------+
89 |Variable|Record|Columns|Format|
90 #========#======#=======#======#
96 +--------+------+-------+------+
97 N1 N2 N3 N4 N5 X1 X2 X3 X4 X5 I
98 -- -- -- -- -- -- -- -- -- -- --
100 6 7 8 9 . 7 8 9 10 . 5
103 if [ $? -ne 0 ] ; then no_result ; fi
106 if [ $? -ne 0 ] ; then fail ; fi