X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fcommand%2Fprint.sh;h=32a96d7f27d480e2077d7914981c2d4a519de4e3;hb=538e1f5d35f8a48d43401b2c7abf7663219b638f;hp=51e0d8eb33172a065aae614c059137e5a917d5c6;hpb=7f3ac8559f71179a95fad28a30882ca476d8ac99;p=pspp-builds.git diff --git a/tests/command/print.sh b/tests/command/print.sh index 51e0d8eb..32a96d7f 100755 --- a/tests/command/print.sh +++ b/tests/command/print.sh @@ -5,10 +5,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 @@ -16,6 +20,7 @@ export STAT_CONFIG_PATH cleanup() { + cd / rm -rf $TEMPDIR } @@ -72,7 +77,7 @@ if [ $? -ne 0 ] ; then no_result ; fi activity="run program" -$SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii --testing-mode $TEMPDIR/print.stat > $TEMPDIR/errs +$SUPERVISOR $PSPP --testing-mode -o raw-ascii --testing-mode $TEMPDIR/print.stat > $TEMPDIR/errs # Note vv --- there are errors in input. Therefore, the command must FAIL if [ $? -eq 0 ] ; then fail ; fi @@ -97,8 +102,9 @@ if [ $? -ne 0 ] ; then fail ; fi activity="compare output" -diff -b -B $TEMPDIR/pspp.list - << EOF -1.1 DATA LIST. Reading free-form data from file $TEMPDIR/data-list.data. +perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list +diff -b $TEMPDIR/pspp.list - << EOF +1.1 DATA LIST. Reading free-form data from "$TEMPDIR/data-list.data". +--------+------+ |Variable|Format| #========#======# @@ -107,8 +113,7 @@ diff -b -B $TEMPDIR/pspp.list - << EOF |C |F8.0 | |D |F8.0 | +--------+------+ - -2.1 PRINT. Writing 1 record(s) to file foo. +2.1 PRINT. Writing 1 record to "foo". +--------+------+-------+------+ |Variable|Record|Columns|Format| #========#======#=======#======# @@ -119,17 +124,12 @@ diff -b -B $TEMPDIR/pspp.list - << EOF |C | 1| 19- 28|N10.0 | |"/" | 1| 29- 29|A1 | +--------+------+-------+------+ - - A B C D -------- -------- -------- -------- . 2.00 3.00 4.00 - . 6.00 7.00 8.00 - . 10.00 11.00 12.00 - -3.1 DATA LIST. Reading free-form data from file $TEMPDIR/data-list.data. +3.1 DATA LIST. Reading free-form data from "$TEMPDIR/data-list.data". +--------+------+ |Variable|Format| #========#======# @@ -138,8 +138,7 @@ diff -b -B $TEMPDIR/pspp.list - << EOF |C |F8.0 | |D |F8.0 | +--------+------+ - -4.1 PRINT. Writing 1 record(s) to the listing file. +4.1 PRINT. Writing 1 record. +--------+------+-------+------+ |Variable|Record|Columns|Format| #========#======#=======#======# @@ -149,7 +148,6 @@ diff -b -B $TEMPDIR/pspp.list - << EOF |D | 1| 28- 35|F8.2 | +--------+------+-------+------+ . 2.00 3.00 4.00 - A B C D -------- -------- -------- -------- . 2.00 3.00 4.00 @@ -163,7 +161,6 @@ diff -b -B $TEMPDIR/pspp.list - << EOF 10.00 11.00 . . 12.00 . . . 12.00 . . . - EOF if [ $? -ne 0 ] ; then fail ; fi