]> git.sesse.net Git - xml-template/commitdiff
Add a simple test harness.
authorsgunderson@bigfoot.com <>
Wed, 6 Sep 2006 14:10:51 +0000 (16:10 +0200)
committersgunderson@bigfoot.com <>
Wed, 6 Sep 2006 14:10:51 +0000 (16:10 +0200)
tests/test.sh [new file with mode: 0755]

diff --git a/tests/test.sh b/tests/test.sh
new file mode 100755 (executable)
index 0000000..fb31c5f
--- /dev/null
@@ -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
+