X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Fpxp%2Fpxp%2Frtests%2Fnegative%2Frun_negative;fp=helm%2FDEVEL%2Fpxp%2Fpxp%2Frtests%2Fnegative%2Frun_negative;h=3c58a4ef851a2f98d8e4fd8630c88f527e2dafa5;hb=c03d2c1fdab8d228cb88aaba5ca0f556318bebc5;hp=0000000000000000000000000000000000000000;hpb=758057e85325f94cd88583feb1fdf6b038e35055;p=helm.git diff --git a/helm/DEVEL/pxp/pxp/rtests/negative/run_negative b/helm/DEVEL/pxp/pxp/rtests/negative/run_negative new file mode 100755 index 000000000..3c58a4ef8 --- /dev/null +++ b/helm/DEVEL/pxp/pxp/rtests/negative/run_negative @@ -0,0 +1,117 @@ +#! /bin/bash + +# $Id$ + + +t=./test_negative + +init_test () { + # $1: Options for test_negative + # $2: Path to test record + options="$1" + input="$2" + output=`dirname $input`/`basename $input .xml`.out + if [ -f "$output" ]; then + echo "Test $input already initialized; skipping" + else + $t $options "$input" >"$output" + echo Test $input initialized. + fi +} + + +check_test () { + # $1: Options for test_negative + # $2: Path to test record + options="$1" + input="$2" + output=`dirname $input`/`basename $input .xml`.out + $t $options "$input" >current.out + if [ -f "$output" ]; then + if cmp "$output" current.out; then + echo Test $input OK + else + echo Test $input FAILED!!! + fi + else + echo Test $input still uninitialized + echo - OUTPUT: + cat current.out + fi +} + + +for_directory () { + what="$1" + shift + options="$1" + shift + while [ $# -gt 0 ]; do + input="$1" + shift + if [ -f "$input" ]; then + $what "$options" "$input" + else + if [ -d "$input" ]; then + for ent in $input/*.xml; do + for_directory $what "$options" $ent + done + else + echo "Not found: $input" >&2 + fi + fi + done +} + + +usage () { + cat <&2 +usage: $0 [ -init -wf ] file ... dir ... +EOF + exit 1 +} + + +action="check_test" +options="" +while true; do + case "x$1" in + x-init) + action="init_test" + shift + ;; + x-wf) + options="$options -wf" + shift + ;; + x-*) + usage + ;; + *) + break + ;; + esac +done + + +if [ $# -gt 0 ]; then + for_directory $action "$options" "$@" +else + for_directory $action -wf \ + data_jclark_notwf/ext-sa data_jclark_notwf/not-sa data_jclark_notwf/sa \ + data_notwf/sa + for_directory $action "" \ + data_jclark_invalid data_invalid +fi + +# ====================================================================== +# $Log$ +# Revision 1.1 2000/11/17 09:57:33 lpadovan +# Initial revision +# +# Revision 1.2 2000/05/01 16:23:39 gerd +# Added data_invalid. +# +# Revision 1.1 2000/05/01 15:58:50 gerd +# Initial revision. +#