summaryrefslogtreecommitdiff
path: root/tests/email-print-mime-structure.sh
blob: 0c0bb505c684abb89cb6e3b6f5df98e554c3e9db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

set -e

test_eml() {
    message="$1"
    shift
    diff -u "$message.out" <(./email-print-mime-structure "$@" < "$message.eml")
}

for eml in tests/email-print-mime-structure/*.eml; do
    base="${eml%%.eml}"
    pgpkey="$base.pgpkey"
    if [ -e "$pgpkey" ]; then
        printf "Testing %s (PGPy)\n" "${eml##*/}"
        test_eml "$base" --pgpkey "$pgpkey"
    else
        printf "Testing %s\n" "${eml##*/}"
        test_eml "$base"
    fi
done