3 # This program tests the SAMPLE function
5 TEMPDIR=/tmp/pspp-tst-$$
6 TESTFILE=$TEMPDIR/`basename $0`.sps
10 # ensure that top_srcdir is absolute
11 cd $top_srcdir; top_srcdir=`pwd`
13 STAT_CONFIG_PATH=$top_srcdir/config
14 export STAT_CONFIG_PATH
51 activity="create program"
52 cat > $TEMPDIR/sample.stat <<EOF
55 data list notable /A 1-2.
71 if [ $? -ne 0 ] ; then no_result ; fi
74 activity="run program"
75 $SUPERVISOR $here/../src/pspp -o raw-ascii --testing-mode $TEMPDIR/sample.stat
76 if [ $? -ne 0 ] ; then no_result ; fi
78 activity="create head"
79 grep -v '^\ *$' $TEMPDIR/pspp.list | head -2 > $TEMPDIR/head
80 if [ $? -ne 0 ] ; then no_result ; fi
82 activity="extract data"
83 grep '[0-9][0-9]*' $TEMPDIR/pspp.list > $TEMPDIR/data
84 if [ $? -ne 0 ] ; then no_result ; fi
87 activity="compare head"
88 diff -B -b $TEMPDIR/head - << EOF
92 if [ $? -ne 0 ] ; then fail ; fi
94 activity="compare data"
95 diff -w $TEMPDIR/data - << EOF > $TEMPDIR/diffs
108 if [ $? -eq 0 ] ; then fail ; fi
110 # Check that there was nothing added
111 grep '^<' $TEMPDIR/diffs
113 if [ $? -eq 0 ] ; then fail ; fi