Fix missing @clicksequence problem with older Texinfo versions.
[pspp-builds.git] / tests / command / examine-percentiles.sh
index b7982d3027b28b0cc2e55d071bffd69d86c3336c..708e5342b27c1f5a9a722acc89023233a03b4fad 100755 (executable)
@@ -5,17 +5,31 @@
 # a few cases
 
 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`
+PSPP=$top_builddir/src/ui/terminal/pspp
 
 # 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
+
+LANG=C
+export LANG
 
 
 cleanup()
 {
+     if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then 
+       echo "NOT cleaning $TEMPDIR" 
+       return ; 
+     fi
+     cd /
      rm -rf $TEMPDIR
 }
 
@@ -48,8 +62,8 @@ mkdir -p $TEMPDIR
 cd $TEMPDIR
 
 activity="create program"
-cat > $TEMPDIR/out.stat <<EOF
-DATA LIST LIST /x *.
+cat > $TESTFILE <<EOF
+DATA LIST LIST /X *.
 BEGIN DATA.
 2.00 
 8.00 
@@ -74,19 +88,19 @@ EOF
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="run program"
-$SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/out.stat
+$SUPERVISOR $PSPP --testing-mode $TESTFILE
 if [ $? -ne 0 ] ; then no_result ; fi
 
 
 activity="compare results"
-diff $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  |
 +--------+------+
-
 2.1 EXAMINE.  Case Processing Summary
 #=#=============================#
 # #            Cases            #
@@ -97,7 +111,6 @@ diff $TEMPDIR/pspp.list - << EOF
 #=#=#=======#=#=======#=#=======#
 #X#3|   100%|0|     0%|3|   100%#
 #=#=#=======#=#=======#=#=======#
-
 2.2 EXAMINE.  Percentiles
 #================#================================#
 #                #             Percentiles        #
@@ -107,7 +120,6 @@ diff $TEMPDIR/pspp.list - << EOF
 #X|HAverage      #.40|.80|2.00|5.00|8.00|8.00|8.00#
 # |Tukey's Hinges#   |   |3.50|5.00|6.50|    |    #
 #=#==============#===#===#====#====#====#====#====#
-
 3.1 EXAMINE.  Case Processing Summary
 #=#=============================#
 # #            Cases            #
@@ -118,7 +130,6 @@ diff $TEMPDIR/pspp.list - << EOF
 #=#=#=======#=#=======#=#=======#
 #X#3|   100%|0|     0%|3|   100%#
 #=#=#=======#=#=======#=#=======#
-
 3.2 EXAMINE.  Percentiles
 #==================#================================#
 #                  #             Percentiles        #
@@ -128,7 +139,6 @@ diff $TEMPDIR/pspp.list - << EOF
 #X|Weighted Average#.30|.60|1.50|3.50|5.75|7.10|7.55#
 # |Tukey's Hinges  #   |   |3.50|5.00|6.50|    |    #
 #=#================#===#===#====#====#====#====#====#
-
 4.1 EXAMINE.  Case Processing Summary
 #=#=============================#
 # #            Cases            #
@@ -139,7 +149,6 @@ diff $TEMPDIR/pspp.list - << EOF
 #=#=#=======#=#=======#=#=======#
 #X#3|   100%|0|     0%|3|   100%#
 #=#=#=======#=#=======#=#=======#
-
 4.2 EXAMINE.  Percentiles
 #================#================================#
 #                #             Percentiles        #
@@ -149,7 +158,6 @@ diff $TEMPDIR/pspp.list - << EOF
 #X|Rounded       #.00|.00|2.00|5.00|5.00|8.00|8.00#
 # |Tukey's Hinges#   |   |3.50|5.00|6.50|    |    #
 #=#==============#===#===#====#====#====#====#====#
-
 5.1 EXAMINE.  Case Processing Summary
 #=#=============================#
 # #            Cases            #
@@ -160,7 +168,6 @@ diff $TEMPDIR/pspp.list - << EOF
 #=#=#=======#=#=======#=#=======#
 #X#3|   100%|0|     0%|3|   100%#
 #=#=#=======#=#=======#=#=======#
-
 5.2 EXAMINE.  Percentiles
 #================#==================================#
 #                #              Percentiles         #
@@ -170,7 +177,6 @@ diff $TEMPDIR/pspp.list - << EOF
 #X|Empirical     #2.00|2.00|2.00|5.00|8.00|8.00|8.00#
 # |Tukey's Hinges#    |    |3.50|5.00|6.50|    |    #
 #=#==============#====#====#====#====#====#====#====#
-
 6.1 EXAMINE.  Case Processing Summary
 #=#=============================#
 # #            Cases            #
@@ -181,7 +187,6 @@ diff $TEMPDIR/pspp.list - << EOF
 #=#=#=======#=#=======#=#=======#
 #X#3|   100%|0|     0%|3|   100%#
 #=#=#=======#=#=======#=#=======#
-
 6.2 EXAMINE.  Percentiles
 #==========================#==================================#
 #                          #              Percentiles         #
@@ -191,7 +196,6 @@ diff $TEMPDIR/pspp.list - << EOF
 #X|Empirical with averaging#2.00|2.00|2.00|5.00|8.00|8.00|8.00#
 # |Tukey's Hinges          #    |    |3.50|5.00|6.50|    |    #
 #=#========================#====#====#====#====#====#====#====#
-
 EOF
 if [ $? -ne 0 ] ; then fail ; fi