Commit 6f9b1a67 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2003-11-29 11:06:34 by szach] removed old test script

Original author: szach
Date: 2003-11-29 11:06:34+00:00
parent 56fdae60
#!/bin/sh
# to be run from CDuce source tree root
VALIDATE="./validate"
ROOT="schema/regtest"
LOG="$ROOT/regtest.log" # where to save test results
EXPECTED="$ROOT/regtest.expected" # expected results, to be compare with $LOG
if [ ! -z "$1" ]; then # argument given: one shot test?
if [ -f "$ROOT/$1" ]; then
if (echo $1 | grep "\.xsd" > /dev/null) then
$VALIDATE $ROOT/$1 $ROOT/`echo "$1" | sed 's/xsd$/xml/'`
elif (echo $1 | grep "\.cd" > /dev/null) then
./cduce $ROOT/$1
else
echo "Don't know what to do with '$1'."
fi
else
echo "Don't know what to do with '$1'."
fi
else # no argument given: perform all tests
rm -f $LOG # clear old logs
for f in $ROOT/*.xsd; do # test each .xsd using "validate"
echo -n "`basename $f` ... " | tee -a $LOG
if ($VALIDATE $f `echo "$f" | sed 's/xsd$/xml/'` > /dev/null 2>&1); then
echo "OK" | tee -a $LOG
else
echo "FAILURE" | tee -a $LOG
fi
done
for s in $ROOT/*.cd; do # run CDuce scripts
echo -n "`basename $s` ... " | tee -a $LOG
if (./cduce $s > /dev/null 2>&1); then
echo "OK" | tee -a $LOG
else
echo "FAILURE" | tee -a $LOG
fi
done
echo
echo "Diffing LOG with EXPECTED ..."
if diff $LOG $EXPECTED; then
echo
echo "You're lucky: all(???) seems fine!"
echo
else
echo
echo "Ah AAAh: something wrong!"
echo
fi
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment