1#!/bin/sh
2
3cd "${0%/*}"
4. common.sh
5
6export ARCHIVE_MAIL="${ARCHIVE_MAIL:-$(pwd)/../archive-mail}"
7if [ ! -x "${ARCHIVE_MAIL}" ]; then
8 printf "'%s' does not exist\n" "${ARCHIVE_MAIL}" 1>&2
9 exit 1
10fi
11
12export TESTDIR="${TMPDIR:-/tmp}/mail-archive-tests"
13trap "rm -rf '${TESTDIR}' 2>/dev/null" INT EXIT
14
15scriptdir="$(pwd)"
16for test in [0-9][0-9][0-9][0-9]-*; do
17 mkdir -p "${TESTDIR}"
18 cd "${TESTDIR}"
19 mmkdir current archive expected
20
21 name="${test##*/}"
22 printf "Running test case '%s': " "${name}"
23
24 "${scriptdir}/${test##*/}"
25 if [ $? -ne 0 ]; then
26 exit 1
27 fi
28
29 printf "OK\n"
30 cd "${scriptdir}" && rm -rf "${TESTDIR}"
31done
32
33exit 0