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 --testing-mode -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 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
98 diff -b $TEMPDIR/pspp.list - <<EOF
99 +------+--------+--------+------------+
100 |Vector|Position|Variable|Print Format|
101 #======#========#========#============#
106 +------+--------+--------+------------+
107 +------+--------+--------+------------+
108 |Vector|Position|Variable|Print Format|
109 #======#========#========#============#
110 |#vec | 1|#vec1 |COMMA10.2 |
111 | | 2|#vec2 |COMMA10.2 |
112 | | 3|#vec3 |COMMA10.2 |
113 | | 4|#vec4 |COMMA10.2 |
114 +------+--------+--------+------------+
115 1.1 DATA LIST. Reading 1 record from INLINE.
116 +--------+------+-------+------+
117 |Variable|Record|Columns|Format|
118 #========#======#=======#======#
124 +--------+------+-------+------+
125 +------+--------+--------+------------+
126 |Vector|Position|Variable|Print Format|
127 #======#========#========#============#
133 +------+--------+--------+------------+
134 +------+--------+--------+------------+
135 |Vector|Position|Variable|Print Format|
136 #======#========#========#============#
141 +------+--------+--------+------------+
145 +------+--------+--------+------------+
151 +------+--------+--------+------------+
153 if [ $? -ne 0 ] ; then fail ; fi