#!/bin/sh 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 expected="$MH_TEST_DIR/$$.expected" actual="$MH_TEST_DIR/$$.actual" cat > "$imapd" < "$expected" < "$actual" check "$actual" "$expected" finish_test exit ${failed:-0}