3 # This program tests the sort command
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="generate stat program"
52 title 'Test SORT procedure'.
54 data list file='$here/sort.data' notable /X000 to X126 1-127.
59 if [ $? -ne 0 ] ; then no_result ; fi
61 activity="run program"
62 $SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE
63 if [ $? -ne 0 ] ; then no_result ; fi
65 # Now there should be some sorted data in $TEMPDIR/pspp.list
66 # We have to do some checks on it.
70 activity="check sorted"
71 sort $TEMPDIR/pspp.list > $TEMPDIR/sortsort
72 if [ $? -ne 0 ] ; then no_result ; fi
74 diff -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