Made tests BSD diff compatible
[pspp] / tests / command / flip.sh
index 269939fd01907c0c344ca3446936eaffde93ef3e..f4eb926fefd916dc47f4819a00efab8af8a11904 100755 (executable)
@@ -3,17 +3,20 @@
 # This program tests the flip command
 
 TEMPDIR=/tmp/pspp-tst-$$
+TESTFILE=$TEMPDIR/`basename $0`.sps
 
 here=`pwd`;
 
 # ensure that top_srcdir is absolute
 cd $top_srcdir; 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
 }
 
@@ -47,7 +50,7 @@ cd $TEMPDIR
 
 activity="create flip.stat"
 cat > $TEMPDIR/flip.stat <<EOF
-data list /n 1 (a) a b c d 2-9.
+data list /N 1 (a) A B C D 2-9.
 list.
 begin data.
 v 1 2 3 4 5
@@ -69,7 +72,8 @@ $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/flip.stat
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="compare output"
-diff  -b -B $TEMPDIR/pspp.list - << EOF
+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.
 +--------+------+-------+------+
 |Variable|Record|Columns|Format|