3 # Tests random distribution functions.
5 TEMPDIR=/tmp/pspp-tst-$$
7 # ensure that top_srcdir and top_builddir are absolute
8 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
9 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
10 top_srcdir=`cd $top_srcdir; pwd`
11 top_builddir=`cd $top_builddir; pwd`
14 STAT_CONFIG_PATH=$top_srcdir/config
15 export STAT_CONFIG_PATH
20 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
21 echo NOT removing directory $TEMPDIR
55 activity="run script to generate random distribution test command file"
56 perl $top_srcdir/tests/expressions/randist/randist.pl \
57 < $top_srcdir/tests/expressions/randist/randist.txt \
59 if [ $? -ne 0 ] ; then no_result ; fi
61 activity="run command file"
62 $SUPERVISOR $top_builddir/src/pspp --testing-mode -o raw-ascii \
63 $TEMPDIR/randist.pspp >$TEMPDIR/randist.err 2> $TEMPDIR/randist.out
64 if [ $? -ne 0 ] ; then fail ; fi
66 for d in beta cauchy chisq exp f gamma laplace logistic lnormal \
67 normal pareto t uniform weibull; do
68 activity="compare output for $d distribution"
69 perl -pi -e 's/^\s*$//g' $top_srcdir/tests/expressions/randist/$d.out $TEMPDIR/$d.out
70 diff -b $top_srcdir/tests/expressions/randist/$d.out $TEMPDIR/$d.out
71 if [ $? -ne 0 ] ; then fail ; fi