Checkin of new directory structure.
[pspp-builds.git] / tests / command / t-test-groups.sh
index 487ff30b3d4c6fec68ebf6834d79920d7ea05960..af93dba830e180a772b29e37a7b07d7347e68e77 100755 (executable)
@@ -3,17 +3,23 @@
 # This program tests that the T-TEST /GROUPS command works
 
 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
 }
 
@@ -46,8 +52,8 @@ mkdir -p $TEMPDIR
 cd $TEMPDIR
 
 activity="create program"
-cat > $TEMPDIR/out.stat <<EOF
-data list list /id * indep * dep1 * dep2 *.
+cat > $TESTFILE <<EOF
+data list list /ID * INDEP * DEP1 * DEP2 *.
 begin data.
 1  1.1 1 3
 2  1.1 2 4
@@ -70,12 +76,13 @@ if [ $? -ne 0 ] ; then no_result ; fi
 
 
 activity="run program"
-$here/../src/pspp -o raw-ascii $TEMPDIR/out.stat
+$SUPERVISOR $top_builddir/src/pspp -o raw-ascii $TESTFILE
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="compare output"
-diff -B -b $TEMPDIR/pspp.list - <<EOF
-1.1 DATA LIST.  Reading free-form data from the command file.
+perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
+diff  -b $TEMPDIR/pspp.list - <<EOF | perl -e 's/^\s*$//g'
+1.1 DATA LIST.  Reading free-form data from INLINE.
 +--------+------+
 |Variable|Format|
 #========#======#