From 005e885b91ffbe4ac3bd84215d10e781ac92128e Mon Sep 17 00:00:00 2001 From: "sgunderson@bigfoot.com" <> Date: Wed, 6 Sep 2006 16:10:51 +0200 Subject: [PATCH 1/1] Add a simple test harness. --- tests/test.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 tests/test.sh 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 + -- 2.39.2