X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=test%2Ftest_all;h=df65454df9050d52c121c78a67a7c7bac33ba7fe;hb=563d8bfe689ee8f0efab714d57550bb6ccaf323b;hp=b05f3834eb03f335c3b62e828a3576430f5526f7;hpb=5c827bf076452564b9e052a22888675fa7678736;p=mimedecode.git diff --git a/test/test_all b/test/test_all index b05f383..df65454 100755 --- a/test/test_all +++ b/test/test_all @@ -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