]> git.sesse.net Git - xml-template/blob - tests/test.sh
Rename php -> php4.
[xml-template] / tests / test.sh
1 #! /bin/sh
2
3 if [ -z "$TESTS" ]; then
4         TESTS="passthru simple clone include attribute attribute2 attribute3 attribute-empty namespace namespace2 structure"
5 fi
6 if [ -z "$LANGUAGES" ]; then
7         LANGUAGES="perl perl-sax php4 python ruby"
8 fi
9
10 for L in $LANGUAGES; do
11         for T in $TESTS; do
12                 printf "%-35s" "Testing $L/$T..."
13                 TEMPFILE=$( tempfile )
14
15                 if [ "$L" = "perl" ]; then
16                         perl -I../perl ../perl/$T.pl > $TEMPFILE
17                 fi
18                 if [ "$L" = "perl-sax" ]; then
19                         perl -I../perl-sax ../perl-sax/$T.pl > $TEMPFILE
20                 fi
21                 if [ "$L" = "php4" ]; then
22                         php4-cgi -q ../php4/$T.php > $TEMPFILE
23                 fi
24                 if [ "$L" = "python" ]; then
25                         python ../python/$T.py > $TEMPFILE
26                 fi
27                 if [ "$L" = "ruby" ]; then
28                         ruby -I../ruby ../ruby/$T.rb > $TEMPFILE
29                 fi
30
31                 perl ./xml-diff.pl $TEMPFILE reference/$T.xml
32                 if [ $? = 0 ]; then     
33                         echo "passed."
34                 fi
35
36                 rm -f $TEMPFILE
37         done
38 done
39