X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=tests%2Ftest.sh;h=43ccadcb1b73ca627066bdb2ec27ba6fe61bda3b;hb=83a41af3311ec494205205ec093ffff0aad56fd0;hp=bbd9ccf4b15993968c69a3d169328db91def4fa0;hpb=4155b1d98117d8ffa9e5d95d2620264a78580e25;p=xml-template diff --git a/tests/test.sh b/tests/test.sh index bbd9ccf..43ccadc 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -1,28 +1,42 @@ #! /bin/sh -TESTS="simple clone include attribute attribute2" -LANGUAGES="perl php python" +if [ -z "$TESTS" ]; then + TESTS="passthru simple clone include attribute attribute2 attribute3 attribute-empty namespace namespace2 structure" +fi +if [ -z "$LANGUAGES" ]; then + LANGUAGES="perl perl-sax php4 php5 python ruby c++0x" +fi for L in $LANGUAGES; do for T in $TESTS; do - echo -n "Testing $L/$T... " + printf "%-35s" "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 + if [ "$L" = "perl-sax" ]; then + perl -I../perl-sax ../perl-sax/$T.pl > $TEMPFILE fi - if [ "$L" = "php" ]; then + if [ "$L" = "php4" ]; then + php4-cgi -q ../php4/$T.php > $TEMPFILE + fi + if [ "$L" = "php5" ]; then + php5-cgi -q ../php5/$T.php > $TEMPFILE + fi + if [ "$L" = "python" ]; then python ../python/$T.py > $TEMPFILE fi + if [ "$L" = "ruby" ]; then + ruby -I../ruby ../ruby/$T.rb > $TEMPFILE + fi + if [ "$L" = "c++0x" ]; then + ( cd ../c++0x && make -s $T ) && ../c++0x/$T $TEMPFILE + fi - perl ./xml-diff.pl $TEMPFILE reference/$T.xml 2>/dev/null + perl ./xml-diff.pl $TEMPFILE reference/$T.xml if [ $? = 0 ]; then echo "passed." - else - echo "FAILED." fi rm -f $TEMPFILE