X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=tests%2Fcommand%2Fmatch-files.sh;h=65d0f4571af54b8e3829c82018b55ec10a8b23e0;hb=8acca2de53c1852f38726f70fc6516b34732a79f;hp=092c49ebc30d033be65302d7fbba1be892e01dab;hpb=2feb80cc7e27079c77255ee8ab6a9aa373980abb;p=pspp diff --git a/tests/command/match-files.sh b/tests/command/match-files.sh index 092c49ebc3..65d0f4571a 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 $name.pspp >/dev/null 2>&1 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 $name.pspp >/dev/null 2>&1 if [ $? -ne 0 ] ; then no_result ; fi activity="check $name output" -diff -b -w -B - pspp.list < $name.pspp </dev/null 2>&1 +if [ $? -ne 0 ] ; then no_result ; fi + +activity="check $name output" +perl -pi -e 's/^\s*$//g' pspp.list +diff -b -w - pspp.list <