Checkin of new directory structure.
[pspp-builds.git] / tests / xforms / casefile.sh
index a3a6df0e28473a0e8e43306ae7251ac5cab4a139..8aa61d12e5389529ab5e6520dbeaf979d3ac466c 100755 (executable)
@@ -4,10 +4,13 @@
 
 TEMPDIR=/tmp/pspp-tst-$$
 
-here=`pwd`;
+# ensure that top_builddir  are absolute
+if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
+if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
+top_builddir=`cd $top_builddir; pwd`
 
 # ensure that top_srcdir is absolute
-cd $top_srcdir; top_srcdir=`pwd`
+top_srcdir=`cd $top_srcdir; pwd`
 
 STAT_CONFIG_PATH=$top_srcdir/config
 export STAT_CONFIG_PATH
@@ -15,6 +18,7 @@ export STAT_CONFIG_PATH
 
 cleanup()
 {
+     cd /
      rm -rf $TEMPDIR
 }
 
@@ -53,11 +57,12 @@ EOF
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="run program"
-$SUPERVISOR $here/../src/pspp --testing-mode $TEMPDIR/casefile.stat > $TEMPDIR/casefile.out
+$SUPERVISOR $top_builddir/src/pspp --testing-mode $TEMPDIR/casefile.stat > $TEMPDIR/casefile.out
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="compare results"
-diff -b -B $TEMPDIR/casefile.out - <<EOF
+perl -pi -e 's/^\s*$//g' $TEMPDIR/casefile.out
+diff -b $TEMPDIR/casefile.out - <<EOF
 Casefile tests succeeded.
 EOF