X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fcommand%2Fprint.sh;h=4a0527588de2cb321887549d094b5927433e6cbb;hb=ee46f6404b033f4d1312c6b52a207ec2da99d94b;hp=32a96d7f27d480e2077d7914981c2d4a519de4e3;hpb=65a4e29574b67921ea899b6a1d45806dca11db00;p=pspp-builds.git diff --git a/tests/command/print.sh b/tests/command/print.sh index 32a96d7f..4a052758 100755 --- a/tests/command/print.sh +++ b/tests/command/print.sh @@ -1,6 +1,21 @@ #!/bin/sh -# This program tests the PRINT transformation +# This program tests unusual aspects of the PRINT and WRITE +# transformations: +# +# - PRINT puts spaces between variables, unless a format +# is specified explicitly. +# +# - WRITE doesn't put space between variables. +# +# - PRINT to an external file prefixes each line with a space. +# +# - PRINT EJECT to an external file indicates a formfeed by a "1" +# in the first column. +# +# - WRITE writes out spaces for system-missing values, not a period. +# +# - When no output is specified, an empty record is output. TEMPDIR=/tmp/pspp-tst-$$ TESTFILE=$TEMPDIR/`basename $0`.sps @@ -17,9 +32,15 @@ top_srcdir=`cd $top_srcdir; pwd` 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 } @@ -52,127 +73,118 @@ mkdir -p $TEMPDIR cd $TEMPDIR -# Copy this file --- it's shared with another test -activity="create data" -cp $top_srcdir/tests/data-list.data $TEMPDIR -if [ $? -ne 0 ] ; then no_result ; fi - - activity="create program" 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) '/'. -print space a. -print outfile="foo" /a b c d. -list. - -data list list table file='$TEMPDIR/data-list.data'/A B C D. -print table/A B C D. -list. - +data list notable /x y 1-2. +begin data. +12 +34 + 6 +7 +90 +end data. + +print /x y. +print eject /x y 1-2. +print /x '-' y. +print. + +print outfile='print.out' /x y. +print eject outfile='print.out' /x y (f1,f1). +print outfile='print.out' /x '-' y. +print outfile='print.out'. + +write outfile='write.out' /x y. +write outfile='write.out' /x y (2(f1)). +write outfile='write.out' /x '-' y. +write outfile='write.out'. + +execute. foobar if [ $? -ne 0 ] ; then no_result ; fi activity="run program" -$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 - -activity="compare error messages" -diff -w $TEMPDIR/errs - <