X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fcommand%2Fbeg-data.sh;h=4c6ee92d3edf4c53e754d58ca4bbf0c79f1505f3;hb=b08603f631a2d998d8c604692fdf13669bb5e510;hp=382e2a036594c327b3700e3892805927872c3395;hpb=c48bf64ab648b9b761a8e0774db3672d8009c64c;p=pspp diff --git a/tests/command/beg-data.sh b/tests/command/beg-data.sh index 382e2a0365..4c6ee92d3e 100755 --- a/tests/command/beg-data.sh +++ b/tests/command/beg-data.sh @@ -3,17 +3,20 @@ # This program tests the BEGIN DATA / END DATA commands TEMPDIR=/tmp/pspp-tst-$$ +TESTFILE=$TEMPDIR/`basename $0`.sps here=`pwd`; # ensure that top_srcdir is absolute cd $top_srcdir; 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 } @@ -46,15 +49,9 @@ mkdir -p $TEMPDIR cd $TEMPDIR activity="create program" -cat > $TEMPDIR/prog.sps << EOF_foobar +cat > $TESTFILE << EOF_foobar title 'Test BEGIN DATA ... END DATA'. -remark EOF ----------------------------------------------------------------------- -First we show that we can input data with BEGIN DATA/END DATA after -a procedure. ----------------------------------------------------------------------- -EOF data list /A B 1-2. list. begin data. @@ -65,11 +62,6 @@ begin data. 90 end data. -remark EOF ----------------------------------------------------------------------- -Next we show that BEGIN DATA/END DATA work fine on their own as well. ----------------------------------------------------------------------- -EOF data list /A B 1-2. begin data. 09 @@ -84,16 +76,12 @@ if [ $? -ne 0 ] ; then no_result ; fi activity="run program" -$SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps +$SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE if [ $? -ne 0 ] ; then no_result ; fi activity="compare data" -diff -b -B $TEMPDIR/pspp.list - << foobar ----------------------------------------------------------------------- -First we show that we can input data with BEGIN DATA/END DATA after -a procedure. ----------------------------------------------------------------------- - +perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list +diff -b $TEMPDIR/pspp.list - << foobar |perl -e 's/^\s*$//g' 1.1 DATA LIST. Reading 1 record from the command file. +--------+------+-------+------+ |Variable|Record|Columns|Format| @@ -110,10 +98,6 @@ A B 7 8 9 0 ----------------------------------------------------------------------- -Next we show that BEGIN DATA/END DATA work fine on their own as well. ----------------------------------------------------------------------- - 2.1 DATA LIST. Reading 1 record from the command file. +--------+------+-------+------+ |Variable|Record|Columns|Format|