3 # This program tests the INPUT PROGRAM command, specifically all of
4 # the examples given in the user manual.
6 TEMPDIR=/tmp/pspp-tst-$$
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
57 activity="create a.data"
63 if [ $? -ne 0 ] ; then no_result ; fi
65 activity="create b.data"
73 if [ $? -ne 0 ] ; then no_result ; fi
75 activity="create test1.pspp"
76 cat > test1.pspp <<EOF
78 DATA LIST NOTABLE FILE='a.data'/X 1-10.
79 DATA LIST NOTABLE FILE='b.data'/Y 1-10.
83 if [ $? -ne 0 ] ; then no_result ; fi
86 $SUPERVISOR $PSPP --testing-mode test1.pspp
87 if [ $? -ne 0 ] ; then no_result ; fi
89 activity="compare test1 results"
90 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
91 diff -b $TEMPDIR/pspp.list - << EOF
98 if [ $? -ne 0 ] ; then fail ; fi
100 activity="create test2.pspp"
101 cat > test2.pspp <<EOF
106 DATA LIST NOTABLE END=#A FILE='a.data'/X 1-10.
109 DATA LIST NOTABLE END=#B FILE='b.data'/Y 1-10.
118 if [ $? -ne 0 ] ; then no_result ; fi
121 $SUPERVISOR $PSPP --testing-mode test2.pspp
122 if [ $? -ne 0 ] ; then no_result ; fi
124 activity="compare test2 results"
125 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
126 diff -b $TEMPDIR/pspp.list - << EOF
128 ---------- ----------
135 if [ $? -ne 0 ] ; then fail ; fi
137 activity="create test3.pspp"
138 cat > test3.pspp <<EOF
143 DATA LIST NOTABLE END=#B FILE='b.data'/X 1-10.
150 DATA LIST NOTABLE END=#A FILE='a.data'/X 1-10.
158 if [ $? -ne 0 ] ; then no_result ; fi
161 $SUPERVISOR $PSPP --testing-mode test3.pspp
162 if [ $? -ne 0 ] ; then no_result ; fi
164 activity="compare test3 results"
165 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
166 diff -b $TEMPDIR/pspp.list - << EOF
178 if [ $? -ne 0 ] ; then fail ; fi
180 activity="create test4.pspp"
181 cat > test4.pspp <<EOF
186 DATA LIST NOTABLE END=#EOF FILE='a.data'/X 1-10.
194 DATA LIST NOTABLE END=#EOF FILE='b.data'/X 1-10.
204 if [ $? -ne 0 ] ; then no_result ; fi
207 $SUPERVISOR $PSPP --testing-mode test4.pspp
208 if [ $? -ne 0 ] ; then no_result ; fi
210 activity="compare test4 results"
211 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
212 diff -b $TEMPDIR/pspp.list - << EOF
224 if [ $? -ne 0 ] ; then fail ; fi
226 # This example differs slightly from the one in the manual in that
227 # it doesn't generate random variates. There's already a test that
228 # checks that random variates are predictable, so we don't need
230 activity="create test5.pspp"
231 cat > test5.pspp <<EOF
239 LIST/FORMAT=NUMBERED.
241 if [ $? -ne 0 ] ; then no_result ; fi
244 $SUPERVISOR $PSPP --testing-mode test5.pspp
245 if [ $? -ne 0 ] ; then no_result ; fi
247 activity="compare test5 results"
248 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
249 diff -b $TEMPDIR/pspp.list - << EOF
303 if [ $? -ne 0 ] ; then fail ; fi