]> diplodocus.org Git - nmh/blob - test/imap/test-gmail-all
expect this commit to be force-replaced periodically
[nmh] / test / imap / test-gmail-all
1 #!/bin/sh
2
3 # TODO this must have bitrotted to oblivion...
4
5 testname=${0#$srcdir/}
6
7 if test -z "$MH_OBJ_DIR"; then
8 srcdir=`dirname "$0"`/../..
9 MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
10 fi
11
12 . "$MH_OBJ_DIR/test/common.sh"
13
14 setup_test_without_data Mail
15
16 imap_cleanup() {
17 #### Save exit status to use as status for this program.
18 status=$?
19 set +e
20
21 "$MH_OBJ_DIR/target/debug/mhimap" imap shutdown
22
23 # TODO have cleanup allow additional cleanup registration?
24 # Or just allow it to accept status as argument.
25 (exit $status)
26 cleanup
27 }
28 trap imap_cleanup 0
29
30 # * LIST (\All \HasNoChildren) "/" "[Gmail]/All Mail"
31 cat >> "$MH" <<EOF
32 oauth-gmail-credential-file: $MH_IMAP_TEST_OAUTH_FILE
33 imap-host: imap.gmail.com
34 imap-port: imaps
35 imap-user: $MH_IMAP_TEST_USER
36 imap-tls: implicit
37 imap-auth: SASL
38 imap-saslmech: xoauth2
39 imap-authservice: gmail
40 imap-mailbox-root: [Gmail]
41 imap-mailbox-exclude: .
42 imap-mailbox-include: All Mail
43 Unseen-Sequence: unseen
44 Managed-Folders: imap
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
48 EOF
49 if [ -n "$MH_TEST_IMAP_LOG_LEVEL" ]; then
50 echo "imap-log-level: $MH_TEST_IMAP_LOG_LEVEL" >> "$MH"
51 echo "imap-log-$MH_TEST_IMAP_LOG_LEVEL-to: $MH_TEST_DIR/$profile/imap.d/log.$MH_TEST_IMAP_LOG_LEVEL" >> "$MH"
52 fi
53
54 covdir="$MH_OBJ_DIR/covdata/${MH_COVERAGE_PROFILE:-default}/$testname"
55 install -d "$covdir"
56 export LLVM_PROFILE_FILE="$covdir/$profile-%m.profraw"
57
58 start_test 'inc All Mail'
59 inc +imap
60 finish_test
61 exit ${failed:-0}