]> git.phdru.name Git - mimedecode.git/blob - test/test_all
Remove tmp after successful test run
[mimedecode.git] / test / test_all
1 #! /bin/sh
2
3 cd "`dirname \"$0\"`" &&
4 MAILCAPS="`pwd`"/.mailcap &&
5 export MAILCAPS &&
6
7 rm -rf tmp &&
8 mkdir tmp || exit 1
9
10 RC=0
11
12 for f in input/*.txt; do
13    f="`basename \"$f\"`"
14    ../mimedecode.py -H test -f utf-8 input/"$f" >tmp/"$f"
15    if cmp -s expected/"$f" tmp/"$f"; then
16       rm tmp/"$f"
17    else
18       RC=1
19       diff --text expected/"$f" tmp/"$f" >tmp/"$f".diff
20    fi
21 done
22
23 if [ "$RC" -eq 0 ]; then
24    rmdir tmp
25 fi
26
27 exit $RC