Checkin of new directory structure.
[pspp-builds.git] / tests / command / trimmed-mean.sh
index ef11003b43fd33af1a648f49c3f0c2abd4747bc1..b4a84926df8f6daec2adfa385cb495d10b8a9c75 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
 }
 
@@ -50,7 +55,7 @@ cd $TEMPDIR
 
 activity="create program"
 cat > $TESTFILE <<EOF
-DATA LIST LIST /x * c *.
+DATA LIST LIST /X * C *.
 BEGIN DATA.
 1 1
 2 49
@@ -68,20 +73,20 @@ if [ $? -ne 0 ] ; then no_result ; fi
 
 
 activity="run program"
-$SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE
+$SUPERVISOR $top_builddir/src/pspp -o raw-ascii $TESTFILE
 if [ $? -ne 0 ] ; then no_result ; fi
 
 
 activity="compare results"
-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
+1.1 DATA LIST.  Reading free-form data from INLINE.
 +--------+------+
 |Variable|Format|
 #========#======#
 |X       |F8.0  |
 |C       |F8.0  |
 +--------+------+
-
 2.1 EXAMINE.  Case Processing Summary
 #=#===============================#
 # #             Cases             #
@@ -92,7 +97,6 @@ diff -b -B $TEMPDIR/pspp.list - << EOF
 #=#==#=======#=#=======#==#=======#
 #X#52|   100%|0|     0%|52|   100%#
 #=#==#=======#=#=======#==#=======#
-
 2.2 EXAMINE.  Descriptives
 #============================================#=========#==========#
 #                                            #Statistic|Std. Error#
@@ -111,7 +115,6 @@ diff -b -B $TEMPDIR/pspp.list - << EOF
 # Skewness                                   #  1.194  |   .330   #
 # Kurtosis                                   #  15.732 |   .650   #
 #============================================#=========#==========#
-
 EOF
 if [ $? -ne 0 ] ; then fail ; fi