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
32 for config in traditional split; do
33 # start each set of tests with a known set of messages
42 mv mail/.notmuch/xapian $DATABASE_PATH
46 test_begin_subtest "count ($config)"
47 output=$(notmuch count '*')
48 test_expect_equal "$output" '52'
50 test_begin_subtest "count+tag ($config)"
53 output=$(notmuch count tag:$tag)
55 test_expect_equal "$output" '52'
57 test_begin_subtest "address ($config)"
58 notmuch address --deduplicate=no --sort=newest-first --output=sender --output=recipients path:foo >OUTPUT
60 Carl Worth <cworth@cworth.org>
61 notmuch@notmuchmail.org
63 test_expect_equal_file EXPECTED OUTPUT
65 test_begin_subtest "dump ($config)"
66 notmuch dump is:attachment and is:signed | sort > OUTPUT
68 #notmuch-dump batch-tag:3 config,properties,tags
69 +attachment +inbox +signed +unread -- id:20091118005829.GB25380@dottiness.seas.harvard.edu
70 +attachment +inbox +signed +unread -- id:20091118010116.GC25380@dottiness.seas.harvard.edu
72 test_expect_equal_file EXPECTED OUTPUT
74 test_begin_subtest "dump + tag + restore ($config)"
75 notmuch dump '*' > EXPECTED
76 notmuch tag -inbox '*'
77 notmuch restore < EXPECTED
79 test_expect_equal_file EXPECTED OUTPUT
81 test_begin_subtest "reindex ($config)"
82 notmuch search --output=messages '*' > EXPECTED
84 notmuch search --output=messages '*' > OUTPUT
85 test_expect_equal_file EXPECTED OUTPUT