aboutsummaryrefslogtreecommitdiffstats
path: root/tests/run
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run')
-rwxr-xr-xtests/run15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/run b/tests/run
index 1eaad54..230ca83 100755
--- a/tests/run
+++ b/tests/run
@@ -38,6 +38,12 @@ fi
# cleanup environment
unset OPENSSL_CONF SSL_CERT_FILE SSL_CERT_DIR
+if [ -z "${INTERIMAP_PATH+x}" ]; then
+ INTERIMAP_PATH="./"
+elif [ -n "$INTERIMAP_PATH" ]; then
+ INTERIMAP_PATH="${INTERIMAP_PATH%/}/"
+fi
+
ROOTDIR="$(mktemp --tmpdir="${TMPDIR:-/dev/shm}" --directory "$1.XXXXXXXXXX")"
declare -a DOVECOT_SERVER=()
trap cleanup EXIT INT TERM
@@ -206,14 +212,17 @@ prepare
interimap() { _interimap_cmd "interimap" "$@"; }
pullimap() { _interimap_cmd "pullimap" "$@"; }
_interimap_cmd() {
- declare -a ENVIRON=()
+ declare -a ENVIRON=() args=()
local script="$1" rv=0
shift
environ_set "local"
[ -z "${OPENSSL_CONF+x}" ] || ENVIRON+=( OPENSSL_CONF="$OPENSSL_CONF" )
[ -z "${SSL_CERT_FILE+x}" ] || ENVIRON+=( SSL_CERT_FILE="$SSL_CERT_FILE" )
[ -z "${SSL_CERT_DIR+x}" ] || ENVIRON+=( SSL_CERT_DIR="$SSL_CERT_DIR" )
- env -i "${ENVIRON[@]}" perl -I./lib -T "./$script" "$@" 2>"$STDERR" || rv=$?
+ [ -z "${INTERIMAP_I:+x}" ] || args+=( perl -I"$INTERIMAP_I" -T )
+ args+=( "$INTERIMAP_PATH$script" "$@" )
+ #printf "I: Running \`%s\`\\n" "${args[*]}" >&3
+ env -i "${ENVIRON[@]}" "${args[@]}" 2>"$STDERR" || rv=$?
cat <"$STDERR" >&2
return $rv
}
@@ -449,7 +458,7 @@ passed() {
# Run test in a sub-shell
declare -a ENVIRON=()
environ_set "local"
-export TMPDIR TESTDIR STDERR "${ENVIRON[@]}"
+export TMPDIR TESTDIR INTERIMAP_PATH INTERIMAP_I STDERR "${ENVIRON[@]}"
export -f environ_set doveadm interimap interimap_init pullimap _interimap_cmd
export -f sqlite3 sample_message deliver ptree_abort step_start step_done passed
export -f check_mailbox_status check_mailbox_status_values check_mailbox_status2