Initial version
[pspp] / tests / command / trimmed-mean.sh
index 8b84a31c47c24d9bb38f916d54518910c6cdc819..1fc45c70e3948583bdef95c8b9128f794ccefac0 100755 (executable)
@@ -4,17 +4,20 @@
 # where the data is weighted towards the centre
 
 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
 }
 
@@ -48,8 +51,8 @@ cd $TEMPDIR
 
 
 activity="create program"
-cat > $TEMPDIR/out.stat <<EOF
-DATA LIST LIST /x * c *.
+cat > $TESTFILE <<EOF
+DATA LIST LIST /X * C *.
 BEGIN DATA.
 1 1
 2 49
@@ -67,12 +70,13 @@ if [ $? -ne 0 ] ; then no_result ; fi
 
 
 activity="run program"
-$SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/out.stat
+$SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE
 if [ $? -ne 0 ] ; then no_result ; fi
 
 
 activity="compare results"
-diff $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 free-form data from the command file.
 +--------+------+
 |Variable|Format|