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
25 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
26 echo "NOT cleaning $TEMPDIR"
61 activity="create a.data"
67 if [ $? -ne 0 ] ; then no_result ; fi
69 activity="create b.data"
77 if [ $? -ne 0 ] ; then no_result ; fi
79 activity="create test1.pspp"
80 cat > test1.pspp <<EOF
82 DATA LIST NOTABLE FILE='a.data'/X 1-10.
83 DATA LIST NOTABLE FILE='b.data'/Y 1-10.
87 if [ $? -ne 0 ] ; then no_result ; fi
90 $SUPERVISOR $PSPP --testing-mode test1.pspp
91 if [ $? -ne 0 ] ; then no_result ; fi
93 activity="compare test1 results"
94 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
95 diff -b $TEMPDIR/pspp.list - << EOF
102 if [ $? -ne 0 ] ; then fail ; fi
104 activity="create test2.pspp"
105 cat > test2.pspp <<EOF
110 DATA LIST NOTABLE END=#A FILE='a.data'/X 1-10.
113 DATA LIST NOTABLE END=#B FILE='b.data'/Y 1-10.
122 if [ $? -ne 0 ] ; then no_result ; fi
125 $SUPERVISOR $PSPP --testing-mode test2.pspp
126 if [ $? -ne 0 ] ; then no_result ; fi
128 activity="compare test2 results"
129 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
130 diff -b $TEMPDIR/pspp.list - << EOF
132 ---------- ----------
139 if [ $? -ne 0 ] ; then fail ; fi
141 activity="create test3.pspp"
142 cat > test3.pspp <<EOF
147 DATA LIST NOTABLE END=#B FILE='b.data'/X 1-10.
154 DATA LIST NOTABLE END=#A FILE='a.data'/X 1-10.
162 if [ $? -ne 0 ] ; then no_result ; fi
165 $SUPERVISOR $PSPP --testing-mode test3.pspp
166 if [ $? -ne 0 ] ; then no_result ; fi
168 activity="compare test3 results"
169 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
170 diff -b $TEMPDIR/pspp.list - << EOF
182 if [ $? -ne 0 ] ; then fail ; fi
184 activity="create test4.pspp"
185 cat > test4.pspp <<EOF
190 DATA LIST NOTABLE END=#EOF FILE='a.data'/X 1-10.
198 DATA LIST NOTABLE END=#EOF FILE='b.data'/X 1-10.
208 if [ $? -ne 0 ] ; then no_result ; fi
211 $SUPERVISOR $PSPP --testing-mode test4.pspp
212 if [ $? -ne 0 ] ; then no_result ; fi
214 activity="compare test4 results"
215 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
216 diff -b $TEMPDIR/pspp.list - << EOF
228 if [ $? -ne 0 ] ; then fail ; fi
230 # This example differs slightly from the one in the manual in that
231 # it doesn't generate random variates. There's already a test that
232 # checks that random variates are predictable, so we don't need
234 activity="create test5.pspp"
235 cat > test5.pspp <<EOF
243 LIST/FORMAT=NUMBERED.
245 if [ $? -ne 0 ] ; then no_result ; fi
248 $SUPERVISOR $PSPP --testing-mode test5.pspp
249 if [ $? -ne 0 ] ; then no_result ; fi
251 activity="compare test5 results"
252 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
253 diff -b $TEMPDIR/pspp.list - << EOF
307 if [ $? -ne 0 ] ; then fail ; fi