3 # This program tests the sort command
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="generate stat program"
50 cat > $TEMPDIR/sort.stat <<EOF
51 title 'Test SORT procedure'.
53 data list file='$here/sort.data' notable /X000 to X126 1-127.
58 if [ $? -ne 0 ] ; then no_result ; fi
60 activity="run program"
61 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/sort.stat
62 if [ $? -ne 0 ] ; then no_result ; fi
64 # Now there should be some sorted data in $TEMPDIR/pspp.list
65 # We have to do some checks on it.
69 activity="check sorted"
70 sort $TEMPDIR/pspp.list > $TEMPDIR/sortsort
71 cp $TEMPDIR/pspp.list ~/pspp.list
72 if [ $? -ne 0 ] ; then no_result ; fi
74 diff -u -B -b $TEMPDIR/sortsort $TEMPDIR/pspp.list
75 if [ $? -ne 0 ] ; then fail ; fi
77 # 2. It should be six elements wide
78 activity="check data width"
79 awk '!/^\ *$/{if (NF!=6) exit 1}' $TEMPDIR/pspp.list
80 if [ $? -ne 0 ] ; then fail ; fi