2 test_description='Configuration of mail-root and database path'
3 . $(dirname "$0")/test-lib.sh || exit 1
6 local test_name=$(basename $0 .sh)
7 cp ${NOTMUCH_CONFIG} notmuch-config-backup.${test_name}
11 local test_name=$(basename $0 .sh)
12 export NOTMUCH_CONFIG="${TMP_DIRECTORY}/notmuch-config"
16 cp notmuch-config-backup.${test_name} ${NOTMUCH_CONFIG}
22 dir="$TMP_DIRECTORY/database.$test_count"
25 notmuch config set database.path $dir
26 notmuch config set database.mail_root $MAIL_DIR
33 dir="$TMP_DIRECTORY/link.$test_count"
35 notmuch config set database.path $dir
36 notmuch config set database.mail_root $MAIL_DIR
40 for config in traditional split symlink; do
41 # start each set of tests with a known set of messages
50 mv mail/.notmuch/xapian $DATABASE_PATH
57 test_begin_subtest "count ($config)"
58 output=$(notmuch count '*')
59 test_expect_equal "$output" '52'
61 test_begin_subtest "count+tag ($config)"
64 output=$(notmuch count tag:$tag)
66 test_expect_equal "$output" '52'
68 test_begin_subtest "address ($config)"
69 notmuch address --deduplicate=no --sort=newest-first --output=sender --output=recipients path:foo >OUTPUT
71 Carl Worth <cworth@cworth.org>
72 notmuch@notmuchmail.org
74 test_expect_equal_file EXPECTED OUTPUT
76 test_begin_subtest "dump ($config)"
77 notmuch dump is:attachment and is:signed | sort > OUTPUT
79 #notmuch-dump batch-tag:3 config,properties,tags
80 +attachment +inbox +signed +unread -- id:20091118005829.GB25380@dottiness.seas.harvard.edu
81 +attachment +inbox +signed +unread -- id:20091118010116.GC25380@dottiness.seas.harvard.edu
83 test_expect_equal_file EXPECTED OUTPUT
85 test_begin_subtest "dump + tag + restore ($config)"
86 notmuch dump '*' > EXPECTED
87 notmuch tag -inbox '*'
88 notmuch restore < EXPECTED
90 test_expect_equal_file EXPECTED OUTPUT
92 test_begin_subtest "reindex ($config)"
93 notmuch search --output=messages '*' > EXPECTED
95 notmuch search --output=messages '*' > OUTPUT
96 test_expect_equal_file EXPECTED OUTPUT