3 # This program tests the SAMPLE function
5 TEMPDIR=/tmp/pspp-tst-$$
9 # ensure that top_srcdir is absolute
10 cd $top_srcdir; top_srcdir=`pwd`
12 export STAT_CONFIG_PATH=$top_srcdir/config
49 activity="create program"
50 cat > $TEMPDIR/sample.stat <<EOF
53 data list notable /a 1-2.
69 if [ $? -ne 0 ] ; then no_result ; fi
72 activity="run program"
73 $SUPERVISOR $here/../src/pspp -o raw-ascii --testing-mode $TEMPDIR/sample.stat
74 if [ $? -ne 0 ] ; then no_result ; fi
76 activity="create head"
77 grep -v '^\ *$' $TEMPDIR/pspp.list | head -2 > $TEMPDIR/head
78 if [ $? -ne 0 ] ; then no_result ; fi
80 activity="extract data"
81 grep '[0-9][0-9]*' $TEMPDIR/pspp.list > $TEMPDIR/data
82 if [ $? -ne 0 ] ; then no_result ; fi
85 activity="compare head"
86 diff -B -b $TEMPDIR/head - << EOF
90 if [ $? -ne 0 ] ; then fail ; fi
92 activity="compare data"
93 diff -w $TEMPDIR/data - << EOF > $TEMPDIR/diffs
106 if [ $? -eq 0 ] ; then fail ; fi
108 # Check that there was nothing added
109 grep '^<' $TEMPDIR/diffs
111 if [ $? -eq 0 ] ; then fail ; fi