]> git.phdru.name Git - mimedecode.git/blobdiff - test/test_all
Docs: Fix INSTALL.txt
[mimedecode.git] / test / test_all
index b05f3834eb03f335c3b62e828a3576430f5526f7..df65454df9050d52c121c78a67a7c7bac33ba7fe 100755 (executable)
@@ -1,18 +1,31 @@
 #! /bin/sh
 
 cd "`dirname \"$0\"`" &&
-MAILCAPS="`pwd`"/.mailcap &&
-export MAILCAPS &&
-
 rm -rf save tmp &&
 mkdir tmp || exit 1
 
+LC_CTYPE=c.UTF-8 &&
+export LC_CTYPE &&
+
+MAILCAPS="`pwd`"/.mailcap &&
+export MAILCAPS &&
+
+: ${PYTHON:=python}
 RC=0
 
+if [ `$PYTHON -c "import sys; print(sys.version[0])"` -eq 2 ]; then
+   PY3=NO
+else
+   PY3=YES
+fi
+
 test1() {
    infile="$1"
    shift
    expfile="$1"
+   if [ $PY3 = YES -a -f expected/"$expfile"-py3 ]; then
+      expfile="$expfile"-py3
+   fi
    shift
 
    $PYTHON ../mimedecode.py -H test -f utf-8 "$@" input/"$infile" >tmp/"$expfile" || return 1