]> git.sesse.net Git - xml-template/blob - tests/test.sh
Adjust the columns in test.sh.
[xml-template] / tests / test.sh
1 #! /bin/sh
2
3 if [ -z "$TESTS" ]; then
4         TESTS="passthru simple clone include attribute attribute2 attribute-empty"
5 fi
6 if [ -z "$LANGUAGES" ]; then
7         LANGUAGES="perl php python"
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" = "php" ]; then
19                         php4-cgi -q ../php/$T.php > $TEMPFILE
20                 fi
21                 if [ "$L" = "python" ]; then
22                         python ../python/$T.py > $TEMPFILE
23                 fi
24
25                 perl ./xml-diff.pl $TEMPFILE reference/$T.xml
26                 if [ $? = 0 ]; then     
27                         echo "passed."
28                 fi
29
30                 rm -f $TEMPFILE
31         done
32 done
33