X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fcommand%2Faggregate.sh;h=ba51161c6a16b6375ca140249d8ed04e387f396c;hb=5f222ad4739550128ce5502b158763bba53bf9bb;hp=90c1351f090763fcfd7d9030d781328e4ef7cfc3;hpb=c0ed03fd27298cf2b18f0fb373e919ab8b4ae4f4;p=pspp-builds.git diff --git a/tests/command/aggregate.sh b/tests/command/aggregate.sh index 90c1351f..ba51161c 100755 --- a/tests/command/aggregate.sh +++ b/tests/command/aggregate.sh @@ -3,17 +3,27 @@ # This program tests the aggregate procedure TEMPDIR=/tmp/pspp-tst-$$ +TESTFILE=$TEMPDIR/aggregate.pspp -here=`pwd`; -# ensure that top_srcdir is absolute -cd $top_srcdir; top_srcdir=`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 -export STAT_CONFIG_PATH=$top_srcdir/config +STAT_CONFIG_PATH=$top_srcdir/config +export STAT_CONFIG_PATH cleanup() { + if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then + echo "NOT cleaning $TEMPDIR" + return ; + fi + cd / rm -rf $TEMPDIR } @@ -45,41 +55,188 @@ mkdir -p $TEMPDIR cd $TEMPDIR -activity="program create" -cat > $TEMPDIR/test.sps << 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.csv < agg-columnwise.csv < $name.pspp + if [ $? -ne 0 ] ; then no_result ; fi + + activity="run $name.pspp" + $SUPERVISOR $PSPP -o pspp.csv -e /dev/null $name.pspp + if [ $? -ne 0 ] ; then no_result ; fi + + activity="check $name output" + perl -pi -e 's/^.*:\d+: //;' pspp.csv + diff -c pspp.csv agg-$missing.csv + if [ $? -ne 0 ] ; then fail ; fi + done + done +done pass;