X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=tests%2Fexpressions%2Frandist.sh;h=58fe386d291f4738661c0385d1ee67faeaf0d180;hb=59990cb7ac648d05a8fe981def5433e5496d0efa;hp=0f303879736dcacf432e0a892992e5a40fcf124d;hpb=d807ad29cc0d3caa4f0e04ee4b75c70a225cfeaf;p=pspp-builds.git diff --git a/tests/expressions/randist.sh b/tests/expressions/randist.sh index 0f303879..58fe386d 100755 --- a/tests/expressions/randist.sh +++ b/tests/expressions/randist.sh @@ -4,18 +4,26 @@ TEMPDIR=/tmp/pspp-tst-$$ -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() { + if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then + echo "NOT cleaning $TEMPDIR" + return ; + fi + cd / rm -rf $TEMPDIR - : } @@ -52,14 +60,15 @@ perl $top_srcdir/tests/expressions/randist/randist.pl \ if [ $? -ne 0 ] ; then no_result ; fi activity="run command file" -$SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii \ +$SUPERVISOR $PSPP --testing-mode \ $TEMPDIR/randist.pspp >$TEMPDIR/randist.err 2> $TEMPDIR/randist.out if [ $? -ne 0 ] ; then fail ; fi for d in beta cauchy chisq exp f gamma laplace logistic lnormal \ normal pareto t uniform weibull; do activity="compare output for $d distribution" - diff -B -b $top_srcdir/tests/expressions/randist/$d.out $TEMPDIR/$d.out + perl $top_srcdir/tests/expressions/randist/compare.pl \ + $top_srcdir/tests/expressions/randist/$d.out $TEMPDIR/$d.out if [ $? -ne 0 ] ; then fail ; fi done