#!/bin/sh testname=${0#$srcdir/} # setup copied from test-scan if test -z "$MH_OBJ_DIR"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test_without_data Mail rm -rf "$MH_TEST_DIR/panda" imap_cleanup() { #### Save exit status to use as status for this program. status=$? set +e [ -n "$imapd_pid" ] && kill $imapd_pid "$MH_OBJ_DIR/target/debug/mhimap" imap shutdown # TODO have cleanup allow additional cleanup registration? # Or just allow it to accept status as argument. (exit $status) cleanup } trap imap_cleanup 0 covdir="$MH_OBJ_DIR/covdata/${MH_COVERAGE_PROFILE:-default}/$testname" install -d "$covdir" export LLVM_PROFILE_FILE="$covdir/$profile-%m.profraw" start_fakeinetd env "HOME=$MH_TEST_DIR/panda" "$PANDA_IMAPD" imapd_pid=$fakeinetd_pid # TODO imap-manager: $MH_LIBEXEC_DIR/folder-managers/imap # TODO imap-socket: relative path # TODO can we come up with reasonable default of socket path? cat >> "$MH" <> "$MH" echo "imap-log-$MH_TEST_IMAP_LOG_LEVEL-to: $MH_TEST_DIR/$profile/imap.d/log.$MH_TEST_IMAP_LOG_LEVEL" >> "$MH" fi mkdir "$MH_TEST_DIR/panda" mkdir "$MH_TEST_DIR/panda/test" expected="$MH_TEST_DIR/$$.expected" actual="$MH_TEST_DIR/$$.actual" cat > "$MH_TEST_DIR/panda/test/folder" < "$expected" <