X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fcommand%2Fprint.sh;h=9caea4e37ada6dabb7eef4d0353f4823f32e7137;hb=8e018d25310cb53e5339b46e95f0abe02db83782;hp=8b67e835323b9a12a90bf1911008f9ad00ab67aa;hpb=d807ad29cc0d3caa4f0e04ee4b75c70a225cfeaf;p=pspp-builds.git diff --git a/tests/command/print.sh b/tests/command/print.sh index 8b67e835..9caea4e3 100755 --- a/tests/command/print.sh +++ b/tests/command/print.sh @@ -5,16 +5,24 @@ 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() { + cd / rm -rf $TEMPDIR } @@ -57,7 +65,7 @@ cat > $TEMPDIR/print.stat << foobar title 'Test PRINT transformation'. data list free table file='$TEMPDIR/data-list.data'/A B C D. -print outfile="foo" table/A(f8.2) '/' B(e8.2) '/' C(n10) '/' D(rbhex16) '/'. +print outfile="foo" table/A(f8.2) '/' B(e8.2) '/' C(n10) '/'. print space a. print outfile="foo" /a b c d. list. @@ -71,7 +79,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 @@ -96,8 +104,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| #========#======# @@ -106,31 +115,23 @@ diff -b -B $TEMPDIR/pspp.list - << EOF |C |F8.0 | |D |F8.0 | +--------+------+ - -2.1 PRINT. Writing 1 record(s) to file foo. -+--------+------+-------+-------+ -|Variable|Record|Columns| Format| -#========#======#=======#=======# -|A | 1| 1- 8|F8.2 | -|"/" | 1| 9- 9|A1 | -|B | 1| 10- 17|E8.2 | -|"/" | 1| 18- 18|A1 | -|C | 1| 19- 28|N10.0 | -|"/" | 1| 29- 29|A1 | -|D | 1| 30- 45|RBHEX16| -|"/" | 1| 46- 46|A1 | -+--------+------+-------+-------+ - - +2.1 PRINT. Writing 1 record to "foo". ++--------+------+-------+------+ +|Variable|Record|Columns|Format| +#========#======#=======#======# +|A | 1| 1- 8|F8.2 | +|"/" | 1| 9- 9| | +|B | 1| 10- 17|E8.2 | +|"/" | 1| 18- 18| | +|C | 1| 19- 28|N10.0 | +|"/" | 1| 29- 29| | ++--------+------+-------+------+ 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| #========#======# @@ -139,8 +140,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| #========#======#=======#======# @@ -150,7 +150,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 @@ -164,18 +163,17 @@ diff -b -B $TEMPDIR/pspp.list - << EOF 10.00 11.00 . . 12.00 . . . 12.00 . . . - EOF if [ $? -ne 0 ] ; then fail ; fi activity="compare print out" diff $TEMPDIR/foo - << EOF - . /2.00E+00/0000000003/0000000000001040/ + . /2.00E+00/0000000003/ . 2.00 3.00 4.00 - . /6.00E+00/0000000007/0000000000002040/ + . /6.00E+00/0000000007/ . 6.00 7.00 8.00 - . /1.00E+01/0000000011/0000000000002840/ + . /1.00E+01/0000000011/ . 10.00 11.00 12.00 EOF if [ $? -ne 0 ] ; then fail ; fi