Checkin of new directory structure.
[pspp] / tests / command / examine.sh
index 445e1dfc2b75e96be5519258be26d60eb1df7972..255c9c6e445dbb6317587882448960adf14030df 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
@@ -88,14 +91,15 @@ 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
 
 # NOTE:  In the following data: Only the extreme values have been checked
 # The descriptives have been blindly pasted.
 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|
 #========#======#
@@ -103,7 +107,6 @@ diff -b -B $TEMPDIR/pspp.list - << EOF
 |W       |F8.0  |
 |BRAND   |F8.0  |
 +--------+------+
-
 Case#  QUALITY        W    BRAND
 ----- -------- -------- --------
     1     3.00     1.00     1.00 
@@ -122,7 +125,6 @@ Case#  QUALITY        W    BRAND
    14     5.00     3.00     3.00 
    15     3.00     1.00     3.00 
    16     6.00     1.00     3.00 
-
 2.1 EXAMINE.  Case Processing Summary
 #===============#===============================#
 #               #             Cases             #
@@ -133,7 +135,6 @@ Case#  QUALITY        W    BRAND
 #===============#==#=======#=#=======#==#=======#
 #Breaking Strain#24|   100%|0|     0%|24|   100%#
 #===============#==#=======#=#=======#==#=======#
-
 2.2 EXAMINE.  Extreme Values
 #=======================#===========#=====#
 #                       #Case Number|Value#
@@ -146,7 +147,6 @@ Case#  QUALITY        W    BRAND
 #                      2#          3| 1.00#
 #                      3#          3| 1.00#
 #=======================#===========#=====#
-
 2.3 EXAMINE.  Descriptives
 #==========================================================#=========#==========#
 #                                                          #Statistic|Std. Error#
@@ -165,7 +165,6 @@ Case#  QUALITY        W    BRAND
 #               Skewness                                   #   .059  |   .472   #
 #               Kurtosis                                   #  -.358  |   .918   #
 #==========================================================#=========#==========#
-
 2.4 EXAMINE.  Case Processing Summary
 #===========================#=============================#
 #                           #            Cases            #
@@ -178,7 +177,6 @@ Case#  QUALITY        W    BRAND
 #               Bloggs      #8|   100%|0|     0%|8|   100%#
 #               Charlies    #8|   100%|0|     0%|8|   100%#
 #===========================#=#=======#=#=======#=#=======#
-
 2.5 EXAMINE.  Extreme Values
 #===================================#===========#=====#
 #               Manufacturer        #Case Number|Value#
@@ -207,7 +205,6 @@ Case#  QUALITY        W    BRAND
 #                                  2#         13| 4.00#
 #                                  3#         13| 4.00#
 #===================================#===========#=====#
-
 2.6 EXAMINE.  Descriptives
 #======================================================================#=========#==========#
 #               Manufacturer                                           #Statistic|Std. Error#
@@ -254,7 +251,6 @@ Case#  QUALITY        W    BRAND
 #                           Skewness                                   #   .304  |   .752   #
 #                           Kurtosis                                   #   .146  |   1.481  #
 #======================================================================#=========#==========#
-
 EOF
 if [ $? -ne 0 ] ; then fail ; fi