X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fcommand%2Fprint.sh;h=32a96d7f27d480e2077d7914981c2d4a519de4e3;hb=538e1f5d35f8a48d43401b2c7abf7663219b638f;hp=538f5dbe9d0d2441341fd26338d664b5abd65009;hpb=b26094b483f97d89025df65a30523a65e716790a;p=pspp-builds.git diff --git a/tests/command/print.sh b/tests/command/print.sh index 538f5dbe..32a96d7f 100755 --- a/tests/command/print.sh +++ b/tests/command/print.sh @@ -3,17 +3,24 @@ # This program tests the PRINT transformation 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 cleanup() { + cd / rm -rf $TEMPDIR } @@ -47,103 +54,57 @@ cd $TEMPDIR # Copy this file --- it's shared with another test activity="create data" -cp $here/data-list.data $TEMPDIR +cp $top_srcdir/tests/data-list.data $TEMPDIR if [ $? -ne 0 ] ; then no_result ; fi activity="create program" -cat > $TEMPFILE/print.stat < $TEMPDIR/print.stat << foobar title 'Test PRINT transformation'. -remark EOF ----------------------------------------------------------------------- -There is no test for DATA LIST FIXED since it is imagined that the -rest of the tests give it a pretty good workout. ----------------------------------------------------------------------- -EOF -remark EOF ----------------------------------------------------------------------- -Testing use of DATA LIST FREE. ----------------------------------------------------------------------- -EOF 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. -remark EOF ----------------------------------------------------------------------- -Testing use of DATA LIST LIST. ----------------------------------------------------------------------- -EOF data list list table file='$TEMPDIR/data-list.data'/A B C D. print table/A B C D. list. -EOF_print +foobar if [ $? -ne 0 ] ; then no_result ; fi activity="run program" -$here/../src/pspp -o raw-ascii $TEMPFILE/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 activity="compare error messages" diff -w $TEMPDIR/errs - <