[Expat-checkins] CVS: expat/tests xmltest.sh,NONE,1.1 .cvsignore,1.2,1.3

Fred L. Drake fdrake@users.sourceforge.net
Mon Apr 29 14:32:06 2002


Update of /cvsroot/expat/expat/tests
In directory usw-pr-cvs1:/tmp/cvs-serv21155/tests

Modified Files:
	.cvsignore 
Added Files:
	xmltest.sh 
Log Message:
Added target to run checks based on xmlwf and James Clark's test cases.
This is not run by "make check" since it requires unzip, wget, and network
access to set up the tests.  Use "make run-xmltext" to run the tests.


--- NEW FILE: xmltest.sh ---
#! /bin/sh

VERBOSE=''

if [ "$1" = '-v' -o "$1" = '--verbose' ] ; then
    VERBOSE="$1"
    shift
fi

if [ ! "$1" = '' ] ; then
    ERRORS=0
    if [ "$VERBOSE" ] ; then
        OUTPUT="/tmp/$$.out"
    else
        OUTPUT="/dev/null"
    fi
    while [ "$1" ] ; do
        FILE="`basename \"$1\"`"
        DIR="`dirname \"$1\"`"
        DIR="`dirname \"$DIR\"`"
        ../xmlwf/xmlwf -d /tmp "$DIR/$FILE"
        diff -u "$DIR/out/$FILE" "/tmp/$FILE" >$OUTPUT
        ERR=$?
        rm "/tmp/$FILE"
        if [ ! "$ERR" = 0 ] ; then
            ERRORS=`expr $ERRORS + 1`
            echo "$DIR/$FILE ... Error"
            cat $OUTPUT
        elif [ "$VERBOSE" ] ; then
            echo "$DIR/$FILE ... Ok"
        fi
        shift
    done
    if [ "$VERBOSE" ] ; then
        rm $OUTPUT
    fi
    if [ ! "$ERRORS" = '0' ] ; then
        echo "    Errors:  $ERRORS"
        exit 1
    fi
else
    SCRIPTDIR="`dirname \"$0\"`"
    cd "$SCRIPTDIR"
    find xmltest -name \*.xml | grep /out/ | xargs ./xmltest.sh $VERBOSE
    if [ ! "$?" = "0" ] ; then
        exit 1
    fi
fi

Index: .cvsignore
===================================================================
RCS file: /cvsroot/expat/expat/tests/.cvsignore,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** .cvsignore	7 Dec 2001 10:19:31 -0000	1.2
--- .cvsignore	29 Apr 2002 21:31:18 -0000	1.3
***************
*** 1,3 ****
--- 1,5 ----
  Makefile
  runtests
+ xmltest
+ xmltest.zip
  .libs