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
58 activity="create prog"
59 cat > $TEMPDIR/vector.stat <<EOF
60 data list notable/x 1.
64 data list notable/x 1.
65 vector #vec(4, comma10.2).
70 data list/x5 x2 x3 x1 x4 1-5.
74 data list notable/u w x y z 1-5.
80 if [ $? -ne 0 ] ; then no_result ; fi
82 activity="run program"
83 $SUPERVISOR $PSPP --testing-mode -e $TEMPDIR/stdout $TEMPDIR/vector.stat
84 if [ $? -ne 0 ] ; then no_result ; fi
86 activity="compare stdout"
87 perl -pi -e 's/^\s*$//g' $TEMPDIR/stdout
88 diff -b $TEMPDIR/stdout - <<EOF
90 if [ $? -ne 0 ] ; then fail ; fi
92 activity="compare results"
93 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
94 diff -b $TEMPDIR/pspp.list - <<EOF
95 +------+--------+--------+------------+
96 |Vector|Position|Variable|Print Format|
97 #======#========#========#============#
102 +------+--------+--------+------------+
103 +------+--------+--------+------------+
104 |Vector|Position|Variable|Print Format|
105 #======#========#========#============#
106 |#vec | 1|#vec1 |COMMA10.2 |
107 | | 2|#vec2 |COMMA10.2 |
108 | | 3|#vec3 |COMMA10.2 |
109 | | 4|#vec4 |COMMA10.2 |
110 +------+--------+--------+------------+
111 1.1 DATA LIST. Reading 1 record from INLINE.
112 +--------+------+-------+------+
113 |Variable|Record|Columns|Format|
114 #========#======#=======#======#
120 +--------+------+-------+------+
121 +------+--------+--------+------------+
122 |Vector|Position|Variable|Print Format|
123 #======#========#========#============#
129 +------+--------+--------+------------+
130 +------+--------+--------+------------+
131 |Vector|Position|Variable|Print Format|
132 #======#========#========#============#
137 +------+--------+--------+------------+
141 +------+--------+--------+------------+
147 +------+--------+--------+------------+
149 if [ $? -ne 0 ] ; then fail ; fi