From: sgunderson@bigfoot.com <> Date: Wed, 6 Sep 2006 14:10:51 +0000 (+0200) Subject: Add a simple test harness. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=005e885b91ffbe4ac3bd84215d10e781ac92128e;p=xml-template Add a simple test harness. --- diff --git a/tests/test.sh b/tests/test.sh new file mode 100755 index 0000000..fb31c5f --- /dev/null +++ b/tests/test.sh @@ -0,0 +1,31 @@ +#! /bin/sh + +TESTS="simple clone include attribute attribute2" +LANGUAGES="perl php python" + +for L in $LANGUAGES; do + for T in $TESTS; do + echo -n "Testing $L/$T... " + TEMPFILE=$( tempfile ) + + if [ "$L" = "perl" ]; then + perl -I../perl ../perl/$T.pl > $TEMPFILE + fi + if [ "$L" = "php" ]; then + php4-cgi ../php/$T.php > $TEMPFILE + fi + if [ "$L" = "php" ]; then + python ../python/$T.py > $TEMPFILE + fi + + ./xml-diff.pl reference/$T.xml 2>/dev/null + if [ $? = 0 ]; then + echo "passed." + else + echo "FAILED." + fi + + rm -f $TEMPFILE + done +done +