#!/bin/sh # TODO FIX uh oh this and the other missing msg cases passed by accident after inc uses ESEARCH # and now switching inc to leave mailbox open has broken it completely! 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" # common.sh sets this to something crazy; did i do that?! testname=${0#$srcdir/} setup_test_without_data Mail imap_cleanup() { #### Save exit status to use as status for this program. status=$? set +e rm -f "$imapd" [ -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" imapd="$MH_TEST_DIR/$$.imapd" start_fakeinetd "$imapd" imapd_pid=$fakeinetd_pid 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 # TODO handle this case next: # UIDNEXT 12 so FETCH 1:11 but nothing is returned; 11 was deleted but never seen. cat > "$imapd" <