Rewrite and improve formatted output routines.
[pspp-builds.git] / tests / command / no_case_size.sh
index 5323b875a3c64d88cb141341e3b684bd9d6eddbd..3d6f2867028a18ef8803ea0fa2bf8269adab2948 100755 (executable)
@@ -7,10 +7,14 @@
 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`
 
 STAT_CONFIG_PATH=$top_srcdir/config
 export STAT_CONFIG_PATH
@@ -64,12 +68,12 @@ if [ $? -ne 0 ] ; then no_result ; fi
 
 
 activity="run program"
-$SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TESTFILE
+$SUPERVISOR $PSPP --testing-mode -o raw-ascii $TESTFILE
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="compare output"
 perl -pi -e 's/^\s*$//g' pspp.list
-diff -b -w pspp.list - <<EOF |perl -e 's/^\s*$//g'
+diff -b -w pspp.list - <<EOF
 1.1 DISPLAY.  
 +--------+-------------------------------------------+--------+
 |Variable|Description                                |Position|
@@ -86,17 +90,15 @@ diff -b -w pspp.list - <<EOF |perl -e 's/^\s*$//g'
 |COUNT   |number of countries                        |       4|
 |        |Format: F8.2                               |        |
 +--------+-------------------------------------------+--------+
-
                             CONT     SIZE      POP    COUNT
 -------------------------------- -------- -------- --------
-Asia                             44579000 3.67E+09    44.00 
-Africa                           30065000 7.78E+08    53.00 
-North America                    24256000 4.83E+08    23.00 
-South America                    17819000 3.42E+08    12.00 
+Asia                             44579000   4E+009    44.00 
+Africa                           30065000   8E+008    53.00 
+North America                    24256000   5E+008    23.00 
+South America                    17819000   3E+008    12.00 
 Antarctica                       13209000      .00      .00 
-Europe                            9938000 7.32E+08    46.00 
+Europe                            9938000   7E+008    46.00 
 Australia/Oceania                 7687000 31000000    14.00 
-
 EOF
 if [ $? -ne 0 ] ; then fail ; fi