X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fcommand%2Fmatch-files.sh;h=367c6ddc6dc3ebd3f38d341fef97ce634d8003f0;hb=5819d4ec857165ed6e0570688bf3df76027f2cf2;hp=092c49ebc30d033be65302d7fbba1be892e01dab;hpb=2feb80cc7e27079c77255ee8ab6a9aa373980abb;p=pspp diff --git a/tests/command/match-files.sh b/tests/command/match-files.sh index 092c49ebc3..367c6ddc6d 100755 --- a/tests/command/match-files.sh +++ b/tests/command/match-files.sh @@ -6,16 +6,22 @@ TEMPDIR=/tmp/pspp-tst-$$ TESTFILE=$TEMPDIR/match-files.pspp -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 : } @@ -113,9 +119,9 @@ A B C D INA INB EOF # Test nonparallel match and table lookup. -dla="data list notable file='a.data' /a b c 1-3 (a)." +dla="data list notable file='a.data' /A B C 1-3 (a)." sa="save outfile='a.sys'." -dlb="data list notable file='b.data' /a b c 1-3 (a)." +dlb="data list notable file='b.data' /A B C 1-3 (a)." sb="save outfile='b.sys'." for types in ff ft; do type1=file @@ -134,21 +140,21 @@ $dla $sa $dlb $sb -match files $type1='a.sys' /in=ina /$type2='b.sys' /in=inb /rename c=D /by a. +match files $type1='a.sys' /in=INA /$type2='b.sys' /in=INB /rename c=D /by a. EOF elif [ $sources = sa ]; then cat </dev/null 2>&1 + $SUPERVISOR $PSPP -o raw-ascii -e /dev/null $name.pspp if [ $? -ne 0 ] ; then no_result ; fi activity="check $name output" - diff -b -w -B pspp.list $types.out + perl -pi -e 's/^\s*$//g' pspp.list + perl -pi -e 's/^\s*$//g' $types.out + diff -b -w pspp.list $types.out if [ $? -ne 0 ] ; then fail ; fi done done @@ -176,17 +184,18 @@ $dla $sa $dlb $sb -match files file='a.sys' /file='b.sys' /rename (a b c=d e f). +match files file='a.sys' /file='b.sys' /rename (a b c=D E F). list. EOF if [ $? -ne 0 ] ; then no_result ; fi activity="run $name.pspp" -$SUPERVISOR $here/../src/pspp -o raw-ascii $name.pspp >/dev/null 2>&1 +$SUPERVISOR $PSPP -o raw-ascii -e /dev/null $name.pspp if [ $? -ne 0 ] ; then no_result ; fi activity="check $name output" -diff -b -w -B - pspp.list < $name.pspp <