2 test_description="locking"
3 . ./test-lib.sh || exit 1
5 if [ "${NOTMUCH_HAVE_XAPIAN_DB_RETRY_LOCK}" = "0" ]; then
6 test_subtest_missing_external_prereq_["lock retry support"]=t
11 test_begin_subtest "blocking open"
12 test_C ${MAIL_DIR} <<'EOF'
16 #include <notmuch-test.h>
19 taggit (notmuch_database_t *db, const char *tag)
21 notmuch_message_t *message;
23 EXPECT0 (notmuch_database_find_message (db, "4EFC743A.3060609@april.org", &message));
24 if (message == NULL) {
25 fprintf (stderr, "unable to find message");
29 EXPECT0 (notmuch_message_add_tag (message, tag));
30 notmuch_message_destroy (message);
34 main (int argc, char **argv)
37 const char *path = argv[1];
41 fprintf (stderr, "fork failed\n");
46 notmuch_database_t *db2;
49 EXPECT0 (notmuch_database_open (path, NOTMUCH_DATABASE_MODE_READ_WRITE, &db2));
50 taggit (db2, "child");
51 EXPECT0 (notmuch_database_close (db2));
53 notmuch_database_t *db;
55 EXPECT0 (notmuch_database_open (path, NOTMUCH_DATABASE_MODE_READ_WRITE, &db));
56 taggit (db, "parent");
58 EXPECT0 (notmuch_database_close (db));
64 notmuch search --output=tags id:4EFC743A.3060609@april.org >> OUTPUT
73 test_expect_equal_file EXPECTED OUTPUT