Checkin of new directory structure.
[pspp-builds.git] / tests / bugs / if_crash.sh
index a2bb34fa0c4ae04a9823d7cf7e0e6d6e1a7a2035..de01dab4d93c29f2c0322b5ddf5a9743f98a8a9b 100755 (executable)
@@ -6,16 +6,21 @@
 TEMPDIR=/tmp/pspp-tst-$$
 TESTFILE=$TEMPDIR/`basename $0`.sps
 
-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`
 
-export STAT_CONFIG_PATH=$top_srcdir/config
+STAT_CONFIG_PATH=$top_srcdir/config
+export STAT_CONFIG_PATH
 
 
 cleanup()
 {
+     cd /
      rm -rf $TEMPDIR
 }
 
@@ -70,7 +75,7 @@ if [ $? -ne 0 ] ; then no_result ; fi
 # So this will have a non zero error status.
 # But it shouldn't crash!
 activity="run_program"
-$SUPERVISOR $here/../src/pspp $TESTFILE > /dev/null
+$SUPERVISOR $top_builddir/src/pspp $TESTFILE > /dev/null
 if [ $? -ne 1 ] ; then fail ; fi