]> git.sesse.net Git - xml-template/blob - tests/test.sh
Add a trivial new “pass through” test.
[xml-template] / tests / test.sh
1 #! /bin/sh
2
3 TESTS="passthru simple clone include attribute attribute2"
4 LANGUAGES="perl php python"
5
6 for L in $LANGUAGES; do
7         for T in $TESTS; do
8                 echo -n "Testing $L/$T... "
9                 TEMPFILE=$( tempfile )
10
11                 if [ "$L" = "perl" ]; then
12                         perl -I../perl ../perl/$T.pl > $TEMPFILE
13                 fi
14                 if [ "$L" = "php" ]; then
15                         php4-cgi -q ../php/$T.php > $TEMPFILE
16                 fi
17                 if [ "$L" = "python" ]; then
18                         python ../python/$T.py > $TEMPFILE
19                 fi
20
21                 perl ./xml-diff.pl $TEMPFILE reference/$T.xml
22                 if [ $? = 0 ]; then     
23                         echo "passed."
24                 fi
25
26                 rm -f $TEMPFILE
27         done
28 done
29