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`
12 PSPP=$top_builddir/src/ui/terminal/pspp
15 STAT_CONFIG_PATH=$top_srcdir/config
16 export STAT_CONFIG_PATH
21 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
22 echo "NOT cleaning $TEMPDIR"
56 activity="run script to generate random distribution test command file"
57 perl $top_srcdir/tests/expressions/randist/randist.pl \
58 < $top_srcdir/tests/expressions/randist/randist.txt \
60 if [ $? -ne 0 ] ; then no_result ; fi
62 activity="run command file"
63 $SUPERVISOR $PSPP --testing-mode \
64 $TEMPDIR/randist.pspp >$TEMPDIR/randist.err 2> $TEMPDIR/randist.out
65 if [ $? -ne 0 ] ; then fail ; fi
67 for d in beta cauchy chisq exp f gamma laplace logistic lnormal \
68 normal pareto t uniform weibull; do
69 activity="compare output for $d distribution"
70 perl $top_srcdir/tests/expressions/randist/compare.pl \
71 $top_srcdir/tests/expressions/randist/$d.out $TEMPDIR/$d.out
72 if [ $? -ne 0 ] ; then fail ; fi