Checkin of new directory structure.
[pspp-builds.git] / tests / expressions / randist.sh
index 9c1ed925c688e013c1ccd2e22aa1a385f8eb7c88..7602aede03e801be7f991552bcadf36de90d1473 100755 (executable)
@@ -4,10 +4,12 @@
 
 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`
 
-# ensure that top_srcdir is absolute
-cd $top_srcdir; top_srcdir=`pwd`
 
 STAT_CONFIG_PATH=$top_srcdir/config
 export STAT_CONFIG_PATH
@@ -19,6 +21,7 @@ cleanup()
         echo NOT removing directory $TEMPDIR
        return ; 
      fi
+     cd /
      rm -rf $TEMPDIR
 }
 
@@ -56,14 +59,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 $top_builddir/src/pspp --testing-mode -o raw-ascii \
     $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 -pi -e 's/^\s*$//g' $top_srcdir/tests/expressions/randist/$d.out $TEMPDIR/$d.out
+    diff -b $top_srcdir/tests/expressions/randist/$d.out $TEMPDIR/$d.out
     if [ $? -ne 0 ] ; then fail ; fi
 done