Checkin of new directory structure.
[pspp-builds.git] / tests / command / flip.sh
index f4eb926fefd916dc47f4819a00efab8af8a11904..15794a19d8d1f9cf9321cc77b358a64247052847 100755 (executable)
@@ -5,10 +5,13 @@
 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`
 
 STAT_CONFIG_PATH=$top_srcdir/config
 export STAT_CONFIG_PATH
@@ -68,13 +71,13 @@ if [ $? -ne 0 ] ; then no_result ; fi
 
 
 activity="run program"
-$SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/flip.stat
+$SUPERVISOR $top_builddir/src/pspp -o raw-ascii $TEMPDIR/flip.stat
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="compare output"
-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 1 record from the command file.
+perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
+diff  -b  $TEMPDIR/pspp.list - << EOF
+1.1 DATA LIST.  Reading 1 record from INLINE.
 +--------+------+-------+------+
 |Variable|Record|Columns|Format|
 #========#======#=======#======#
@@ -84,7 +87,6 @@ diff  -b  $TEMPDIR/pspp.list - << EOF | perl -e 's/^\s*$//g'
 |C       |     1|  6-  7|F2.0  |
 |D       |     1|  8-  9|F2.0  |
 +--------+------+-------+------+
-
 N  A  B  C  D
 - -- -- -- --
 v  1  2  3  4 
@@ -92,14 +94,12 @@ w  6  7  8  9
 x 11 12 13 14 
 y 16 17 18 19 
 z 21 22 23 24 
-
 CASE_LBL        V        W        X        Y        Z
 -------- -------- -------- -------- -------- --------
 A            1.00     6.00    11.00    16.00    21.00 
 B            2.00     7.00    12.00    17.00    22.00 
 C            3.00     8.00    13.00    18.00    23.00 
 D            4.00     9.00    14.00    19.00    24.00 
-
 CASE_LBL        A        B        C        D
 -------- -------- -------- -------- --------
 V            1.00     2.00     3.00     4.00