X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fcommand%2Faggregate.sh;h=b85edba304dc7c32c21c2c4f921833a000b2cb30;hb=e08ba3a0b4be7ebf4f049fa4ead1f0f1508bd7f8;hp=c03852ecd702d5bc05f3289f38cceb9f7c09b31f;hpb=a19e7749cdb8713316fde220f2fc9a5ad5dc79ed;p=pspp-builds.git diff --git a/tests/command/aggregate.sh b/tests/command/aggregate.sh index c03852ec..b85edba3 100755 --- a/tests/command/aggregate.sh +++ b/tests/command/aggregate.sh @@ -3,19 +3,23 @@ # This program tests the aggregate procedure TEMPDIR=/tmp/pspp-tst-$$ -TESTFILE=$TEMPDIR/`basename $0`.sps +TESTFILE=$TEMPDIR/aggregate.pspp -here=`pwd`; +# ensure that top_srcdir and top_builddir are absolute +if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi +if [ -z "$top_builddir" ] ; then top_builddir=. ; fi +top_srcdir=`cd $top_srcdir; pwd` +top_builddir=`cd $top_builddir; pwd` +PSPP=$top_builddir/src/ui/terminal/pspp -# ensure that top_srcdir is absolute -cd $top_srcdir; top_srcdir=`pwd` - -export STAT_CONFIG_PATH=$top_srcdir/config +STAT_CONFIG_PATH=$top_srcdir/config +export STAT_CONFIG_PATH cleanup() { + cd / rm -rf $TEMPDIR } @@ -47,41 +51,170 @@ mkdir -p $TEMPDIR cd $TEMPDIR -activity="program create" -cat > $TESTFILE << EOF - -data list notable /x y 1-2. -begin data. -13 -27 -30 -12 -26 -11 -10 -28 -29 -14 -15 -end data. -sort cases by x. -aggregate /missing=columnwise /document /presorted/break=x(a) /z'label for z'=sum(y)/foo=nu. -list. +activity="data create" +cat > aggregate.data < agg-skel.pspp < agg-itemwise.out < agg-columnwise.out < $name.pspp + if [ $? -ne 0 ] ; then no_result ; fi + + activity="run $name.pspp" + $SUPERVISOR $PSPP --testing-mode -o raw-ascii $name.pspp >/dev/null 2>&1 + if [ $? -ne 0 ] ; then no_result ; fi + + activity="check $name output" + perl -pi -e 's/^\s*$//g' pspp.list agg-$missing.out + diff -b -w pspp.list agg-$missing.out + if [ $? -ne 0 ] ; then fail ; fi + done + done +done pass;