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(a).
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 if [ $? -ne 0 ] ; then no_result ; fi
73 diff -B -b $TEMPDIR/sortsort $TEMPDIR/pspp.list
74 if [ $? -ne 0 ] ; then fail ; fi
76 # 2. It should be six elements wide
77 activity="check data width"
78 awk '!/^\ *$/{if (NF!=6) exit 1}' $TEMPDIR/pspp.list
79 if [ $? -ne 0 ] ; then fail ; fi