]> git.sesse.net Git - xml-template/blob - tests/test.sh
Tweak C++0x API a bit, to prepare for include. Also, output to stdout instead of...
[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 php5 python ruby c++0x"
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" = "php5" ]; then
25                         php5-cgi -q ../php5/$T.php > $TEMPFILE
26                 fi
27                 if [ "$L" = "python" ]; then
28                         python ../python/$T.py > $TEMPFILE
29                 fi
30                 if [ "$L" = "ruby" ]; then
31                         ruby -I../ruby ../ruby/$T.rb > $TEMPFILE
32                 fi
33                 if [ "$L" = "c++0x" ]; then
34                         ( cd ../c++0x && make -s $T ) && ../c++0x/$T > $TEMPFILE
35                 fi
36
37                 perl ./xml-diff.pl $TEMPFILE reference/$T.xml
38                 if [ $? = 0 ]; then     
39                         echo "passed."
40                 fi
41
42                 rm -f $TEMPFILE
43         done
44 done
45