3 #*************************************************************************
4 # "run-tests" is free software: you can redistribute it and/or modify *
5 # it under the terms of the GNU Affero Public License as published by *
6 # the Free Software Foundation, either version 3 of the License, or *
7 # (at your option) any later version. *
9 # "run-tests" is distributed in the hope that it will be useful, *
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 # GNU Affero Public License for more details. *
14 # You should have received a copy of the GNU Affero Public License *
15 # along with Edward. If not, see <http://www.gnu.org/licenses/>. *
17 # Copyright (C) 2015 Andrew Engelbrecht (AGPLv3+) *
18 #*************************************************************************
21 G_HOME
=.
/tests
/testgnupghome
28 for i
in $
(seq "$COUNT") ; do
30 TEST_INPUT
="./tests/test$i.eml"
31 TEST_OUTPUT
="./tests/out$i.txt"
33 _exec_compare
"$TEST_INPUT" "$TEST_OUTPUT"
36 ERROR_COUNT
="$(expr "$ERROR_COUNT" + "$ERROR")"
39 if [ "$ERROR_COUNT" != "0" ] ; then
40 echo "*** Failed test count: $ERROR_COUNT" >&2
48 function _exec_compare
{
53 OUT_DIFF
="$(time ./edward < "$TEST_INPUT" | GNUPGHOME="$G_HOME" gpg 2> /dev/null | ./tests/flatten-mime | diff -Z -u "$TEST_OUTPUT" - )"
55 if [ -n "$OUT_DIFF" ] ; then
56 echo "*** test 1 failed! difference:" >&2