]> git.notmuchmail.org Git - notmuch/commitdiff
test: drop use of db_ending
authorDavid Bremner <david@tethera.net>
Thu, 30 Jul 2020 00:01:30 +0000 (21:01 -0300)
committerDavid Bremner <david@tethera.net>
Sat, 1 Aug 2020 23:27:30 +0000 (20:27 -0300)
This will allow the dropping of the test for the default ending from
configure.

test/T050-new.sh
test/T060-count.sh
test/T150-tagging.sh
test/T560-lib-error.sh
test/test-lib.sh

index dfc8508f83e20ea93d370ec6a059d12df52e93db..009b26336a73e9c88c415d9e1ea909d68060e367 100755 (executable)
@@ -341,9 +341,9 @@ notmuch config set new.tags $OLDCONFIG
 
 
 test_begin_subtest "Xapian exception: read only files"
-chmod u-w  ${MAIL_DIR}/.notmuch/xapian/*.${db_ending}
+chmod u-w  ${MAIL_DIR}/.notmuch/xapian/*.*
 output=$(NOTMUCH_NEW --debug 2>&1 | sed 's/: .*$//' )
-chmod u+w  ${MAIL_DIR}/.notmuch/xapian/*.${db_ending}
+chmod u+w  ${MAIL_DIR}/.notmuch/xapian/*.*
 test_expect_equal "$output" "A Xapian exception occurred opening database"
 
 
index 0c0bf47309e930477f0b69fafeb93130f747fd3c..a1ebf8ba527ea30948c3abd79427a6fa5e83277b 100755 (executable)
@@ -95,7 +95,8 @@ test_expect_equal_file EXPECTED OUTPUT
 
 backup_database
 test_begin_subtest "error message for database open"
-dd if=/dev/zero of="${MAIL_DIR}/.notmuch/xapian/postlist.${db_ending}" count=3
+target=(${MAIL_DIR}/.notmuch/xapian/postlist.*)
+dd if=/dev/zero of="$target" count=3
 notmuch count '*' 2>OUTPUT 1>/dev/null
 output=$(sed 's/^\(A Xapian exception [^:]*\):.*$/\1/' OUTPUT)
 test_expect_equal "${output}" "A Xapian exception occurred opening database"
@@ -107,7 +108,7 @@ set logging file count-files-gdb.log
 set logging on
 break count_files
 commands
-shell cp /dev/null ${MAIL_DIR}/.notmuch/xapian/postlist.${db_ending}
+shell cp /dev/null ${MAIL_DIR}/.notmuch/xapian/postlist.*
 continue
 end
 run
index 208b4b9806405e5c4e90b8d7f1af56afe6a4e412..2f0b3531412db146e500eff1ea43235ab53284d2 100755 (executable)
@@ -305,9 +305,9 @@ test_begin_subtest "Tag name beginning with -"
 test_expect_code 1 'notmuch tag +- One'
 
 test_begin_subtest "Xapian exception: read only files"
-chmod u-w  ${MAIL_DIR}/.notmuch/xapian/*.${db_ending}
+chmod u-w  ${MAIL_DIR}/.notmuch/xapian/*.*
 output=$(notmuch tag +something '*' 2>&1 | sed 's/: .*$//' )
-chmod u+w  ${MAIL_DIR}/.notmuch/xapian/*.${db_ending}
+chmod u+w  ${MAIL_DIR}/.notmuch/xapian/*.*
 test_expect_equal "$output" "A Xapian exception occurred opening database"
 
 test_done
index 70df292a8c0c16bce12305e8206ff6847af81a70..260ac1200a2daa0b7a1809076371959cd0ab8f4c 100755 (executable)
@@ -211,8 +211,7 @@ int main (int argc, char** argv)
      fprintf (stderr, "error opening database: %d %s\n", stat, msg ? msg : "");
      exit (1);
    }
-   path = talloc_asprintf (db, "%s/.notmuch/xapian/postlist.${db_ending}", argv[1]);
-   fd = open(path,O_WRONLY|O_TRUNC);
+   fd = open(argv[2],O_WRONLY|O_TRUNC);
    if (fd < 0) {
        fprintf (stderr, "error opening %s\n", argv[1]);
        exit (1);
@@ -228,9 +227,10 @@ cat <<'EOF' > c_tail
 }
 EOF
 
+POSTLIST_PATH=(${MAIL_DIR}/.notmuch/xapian/postlist.*)
 backup_database
 test_begin_subtest "Xapian exception finding message"
-cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
+cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} ${POSTLIST_PATH}
    {
        notmuch_message_t *message = NULL;
        stat = notmuch_database_find_message (db, "id:nonexistent", &message);
@@ -247,7 +247,7 @@ restore_database
 
 backup_database
 test_begin_subtest "Xapian exception getting tags"
-cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
+cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} ${POSTLIST_PATH}
    {
        notmuch_tags_t *tags = NULL;
        tags = notmuch_database_get_all_tags (db);
@@ -265,7 +265,7 @@ restore_database
 
 backup_database
 test_begin_subtest "Xapian exception creating directory"
-cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
+cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} ${POSTLIST_PATH}
    {
        notmuch_directory_t *directory = NULL;
        stat = notmuch_database_get_directory (db, "none/existing", &directory);
@@ -282,7 +282,7 @@ restore_database
 
 backup_database
 test_begin_subtest "Xapian exception searching messages"
-cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
+cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} ${POSTLIST_PATH}
    {
        notmuch_messages_t *messages = NULL;
        notmuch_query_t *query=notmuch_query_create (db, "*");
@@ -301,7 +301,7 @@ restore_database
 
 backup_database
 test_begin_subtest "Xapian exception counting messages"
-cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
+cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR} ${POSTLIST_PATH}
    {
        int count;
        notmuch_query_t *query=notmuch_query_create (db, "id:87ocn0qh6d.fsf@yoom.home.cworth.org");
index 31c858d11d1e6f03eb67d2e26011468e4df8c15e..527c9e8b8eb553aeebad8263716f681f1320a2d5 100644 (file)
@@ -1261,17 +1261,6 @@ test -z "$NO_PYTHON" && test_set_prereq PYTHON
 ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
 rm -f y
 
-# convert variable from configure to more convenient form
-case "$NOTMUCH_DEFAULT_XAPIAN_BACKEND" in
-    glass)
-       db_ending=glass
-    ;;
-    chert)
-       db_ending=DB
-    ;;
-    *)
-       error "Unknown Xapian backend $NOTMUCH_DEFAULT_XAPIAN_BACKEND"
-esac
 # declare prerequisites for external binaries used in tests
 test_declare_external_prereq dtach
 test_declare_external_prereq emacs