5 # setup copied from test-scan
7 if test -z "$MH_OBJ_DIR"; then
8 srcdir
=`dirname "$0"`/..
/..
9 MH_OBJ_DIR
=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
12 .
"$MH_OBJ_DIR/test/common.sh"
14 setup_test_without_data Mail
16 rm -rf "$MH_TEST_DIR/panda"
19 #### Save exit status to use as status for this program.
23 [ -n "$imapd_pid" ] && kill $imapd_pid
24 "$MH_OBJ_DIR/target/debug/mhimap" imap shutdown
26 # TODO have cleanup allow additional cleanup registration?
27 # Or just allow it to accept status as argument.
33 covdir
="$MH_OBJ_DIR/covdata/${MH_COVERAGE_PROFILE:-default}/$testname"
35 export LLVM_PROFILE_FILE
="$covdir/$profile-%m.profraw"
37 start_fakeinetd env
"HOME=$MH_TEST_DIR/panda" "$PANDA_IMAPD"
38 imapd_pid
=$fakeinetd_pid
40 # TODO imap-manager: $MH_LIBEXEC_DIR/folder-managers/imap
41 # TODO imap-socket: relative path
42 # TODO can we come up with reasonable default of socket path?
45 imap-manager: $MH_OBJ_DIR/target/debug/imap-folder-manager
46 imap-socket: $MH_TEST_DIR/Mail/imap.d/socket
47 imap-db: $MH_TEST_DIR/Mail/imap.d
49 imap-port: $fakeinetd_port
51 imap-tls: don't protect my data i know what i'm doing
52 imap-mailbox-root: test/
54 if [ -n "$MH_TEST_IMAP_LOG_LEVEL" ]; then
55 echo "imap-log-level: $MH_TEST_IMAP_LOG_LEVEL" >> "$MH"
56 echo "imap-log-$MH_TEST_IMAP_LOG_LEVEL-to: $MH_TEST_DIR/$profile/imap.d/log.$MH_TEST_IMAP_LOG_LEVEL" >> "$MH"
59 mkdir "$MH_TEST_DIR/panda"
60 mkdir "$MH_TEST_DIR/panda/test"
62 expected
="$MH_TEST_DIR/$$.expected"
63 actual
="$MH_TEST_DIR/$$.actual"
65 cat > "$MH_TEST_DIR/panda/test/fold1" <<EOF
66 From nmh@example.com Sat Oct 24 19:20:38 2020 -0500
67 Date:Sat, 24 Oct 2020 19:20:38 -0500
70 X-IMAPbase: 1603585238 1
81 check_exit
'-eq 0' inc
+imap
83 ################################################################################
84 start_test
'rmm over IMAP'
86 check_exit
'-eq 0' rmm
-unlink +imap
/fold1
1
88 ################################################################################
89 start_test
'scan shows no messages'
91 cat > "$expected" <<EOF
92 scan: no messages match specification
94 scan
-width 80 +imap
/fold1
> "$actual" 2>&1 || :
95 check
"$actual" "$expected"