3 # This program tests the MATCH FILES procedure
5 TEMPDIR=/tmp/pspp-tst-$$
6 TESTFILE=$TEMPDIR/match-files.pspp
11 # ensure that top_srcdir is absolute
12 cd $top_srcdir; top_srcdir=`pwd`
15 export STAT_CONFIG_PATH=$top_srcdir/config
51 activity="data create"
67 if [ $? -ne 0 ] ; then no_result ; fi
76 if [ $? -ne 0 ] ; then no_result ; fi
115 # Test nonparallel match and table lookup.
116 dla="data list notable file='a.data' /A B C 1-3 (a)."
117 sa="save outfile='a.sys'."
118 dlb="data list notable file='b.data' /A B C 1-3 (a)."
119 sb="save outfile='b.sys'."
120 for types in ff ft; do
122 if [ $types = ff ]; then
127 for sources in ss sa as; do
128 name="$types-$sources"
129 activity="create $name.pspp"
131 if [ $sources = ss ]; then
137 match files $type1='a.sys' /in=INA /$type2='b.sys' /in=INB /rename c=D /by a.
139 elif [ $sources = sa ]; then
144 match files $type1='a.sys' /in=INA /$type2=* /in=INB /rename c=D /by a.
146 elif [ $sources = as ]; then
151 match files $type1=* /in=INA /$type2='b.sys' /in=INB /rename c=D /by a.
154 activity="internal error"
159 if [ $? -ne 0 ] ; then no_result ; fi
161 activity="run $name.pspp"
162 $SUPERVISOR $here/../src/pspp -o raw-ascii $name.pspp >/dev/null 2>&1
163 if [ $? -ne 0 ] ; then no_result ; fi
165 activity="check $name output"
166 diff -b -w -B pspp.list $types.out
167 if [ $? -ne 0 ] ; then fail ; fi
171 # Test parallel match.
173 activity="create $name.pspp"
174 cat > $name.pspp <<EOF
179 match files file='a.sys' /file='b.sys' /rename (a b c=D E F).
182 if [ $? -ne 0 ] ; then no_result ; fi
184 activity="run $name.pspp"
185 $SUPERVISOR $here/../src/pspp -o raw-ascii $name.pspp >/dev/null 2>&1
186 if [ $? -ne 0 ] ; then no_result ; fi
188 activity="check $name output"
189 diff -b -w -B - pspp.list <<EOF
206 if [ $? -ne 0 ] ; then fail ; fi