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 export STAT_CONFIG_PATH=$top_srcdir/config
50 activity="create program"
51 cat > $TEMPDIR/sample.stat <<EOF
54 data list notable /a 1-2.
70 if [ $? -ne 0 ] ; then no_result ; fi
73 activity="run program"
74 $SUPERVISOR $here/../src/pspp -o raw-ascii --testing-mode $TEMPDIR/sample.stat
75 if [ $? -ne 0 ] ; then no_result ; fi
77 activity="create head"
78 grep -v '^\ *$' $TEMPDIR/pspp.list | head -2 > $TEMPDIR/head
79 if [ $? -ne 0 ] ; then no_result ; fi
81 activity="extract data"
82 grep '[0-9][0-9]*' $TEMPDIR/pspp.list > $TEMPDIR/data
83 if [ $? -ne 0 ] ; then no_result ; fi
86 activity="compare head"
87 diff -B -b $TEMPDIR/head - << EOF
91 if [ $? -ne 0 ] ; then fail ; fi
93 activity="compare data"
94 diff -w $TEMPDIR/data - << EOF > $TEMPDIR/diffs
107 if [ $? -eq 0 ] ; then fail ; fi
109 # Check that there was nothing added
110 grep '^<' $TEMPDIR/diffs
112 if [ $? -eq 0 ] ; then fail ; fi