* WIP: update for xapian 1.3.5 @ 2016-04-05 11:18 David Bremner 2016-04-05 11:18 ` [PATCH 1/2] test: improve error handling in lib-error tests David Bremner 2016-04-05 11:18 ` [PATCH 2/2] WIP: update test suite for glass xapian backend David Bremner 0 siblings, 2 replies; 8+ messages in thread From: David Bremner @ 2016-04-05 11:18 UTC (permalink / raw) To: notmuch In Xapian 1.3.5, the glass backend is default. This breaks 11 tests that assume things about internal database file structure. This isn't a complete fix, but at least gets rid of the noise if someone is also working on this. I think the first patch is OK/useful independent of xapian versions. ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/2] test: improve error handling in lib-error tests 2016-04-05 11:18 WIP: update for xapian 1.3.5 David Bremner @ 2016-04-05 11:18 ` David Bremner 2016-04-06 10:27 ` Update test suite for glass backend David Bremner 2016-04-05 11:18 ` [PATCH 2/2] WIP: update test suite for glass xapian backend David Bremner 1 sibling, 1 reply; 8+ messages in thread From: David Bremner @ 2016-04-05 11:18 UTC (permalink / raw) To: notmuch There is at least one bug fixed here (missing parameter to printf), even if exiting via segfault is considered OK. --- test/T560-lib-error.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh index 59a479c..49d3674 100755 --- a/test/T560-lib-error.sh +++ b/test/T560-lib-error.sh @@ -202,16 +202,20 @@ int main (int argc, char** argv) notmuch_database_t *db; notmuch_status_t stat; char *path; + char *msg = NULL; int fd; - stat = notmuch_database_open (argv[1], NOTMUCH_DATABASE_MODE_READ_WRITE, &db); + stat = notmuch_database_open_verbose (argv[1], NOTMUCH_DATABASE_MODE_READ_WRITE, &db, &msg); if (stat != NOTMUCH_STATUS_SUCCESS) { - fprintf (stderr, "error opening database: %d\n", stat); + fprintf (stderr, "error opening database: %d %s\n", stat, msg ? msg : ""); + exit (1); } path = talloc_asprintf (db, "%s/.notmuch/xapian/postlist.DB", argv[1]); fd = open(path,O_WRONLY|O_TRUNC); - if (fd < 0) - fprintf (stderr, "error opening %s\n"); + if (fd < 0) { + fprintf (stderr, "error opening %s\n", argv[1]); + exit (1); + } EOF cat <<'EOF' > c_tail if (stat) { -- 2.8.0.rc3 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Update test suite for glass backend 2016-04-05 11:18 ` [PATCH 1/2] test: improve error handling in lib-error tests David Bremner @ 2016-04-06 10:27 ` David Bremner 2016-04-06 10:27 ` [PATCH 1/3] test: improve error handling in lib-error tests David Bremner ` (2 more replies) 0 siblings, 3 replies; 8+ messages in thread From: David Bremner @ 2016-04-06 10:27 UTC (permalink / raw) To: David Bremner, notmuch Since the previous version - I fixed the atomicity test by disabling a chert only optimization - Talked to Olly Betts about the general approach. We didn't come up with a radically different approach than what is here. I think these should probably go in 0.22, as it would be nice to have the test suite run with the newest version of xapian available. ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/3] test: improve error handling in lib-error tests 2016-04-06 10:27 ` Update test suite for glass backend David Bremner @ 2016-04-06 10:27 ` David Bremner 2016-04-06 10:27 ` [PATCH 2/3] test/atomicity: guard chert-only optimization David Bremner 2016-04-06 10:27 ` [PATCH 3/3] test: cope with glass backend file naming variations David Bremner 2 siblings, 0 replies; 8+ messages in thread From: David Bremner @ 2016-04-06 10:27 UTC (permalink / raw) To: David Bremner, notmuch There is at least one bug fixed here (missing parameter to printf), even if exiting via segfault is considered OK. --- test/T560-lib-error.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh index 59a479c..49d3674 100755 --- a/test/T560-lib-error.sh +++ b/test/T560-lib-error.sh @@ -202,16 +202,20 @@ int main (int argc, char** argv) notmuch_database_t *db; notmuch_status_t stat; char *path; + char *msg = NULL; int fd; - stat = notmuch_database_open (argv[1], NOTMUCH_DATABASE_MODE_READ_WRITE, &db); + stat = notmuch_database_open_verbose (argv[1], NOTMUCH_DATABASE_MODE_READ_WRITE, &db, &msg); if (stat != NOTMUCH_STATUS_SUCCESS) { - fprintf (stderr, "error opening database: %d\n", stat); + fprintf (stderr, "error opening database: %d %s\n", stat, msg ? msg : ""); + exit (1); } path = talloc_asprintf (db, "%s/.notmuch/xapian/postlist.DB", argv[1]); fd = open(path,O_WRONLY|O_TRUNC); - if (fd < 0) - fprintf (stderr, "error opening %s\n"); + if (fd < 0) { + fprintf (stderr, "error opening %s\n", argv[1]); + exit (1); + } EOF cat <<'EOF' > c_tail if (stat) { -- 2.8.0.rc3 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/3] test/atomicity: guard chert-only optimization 2016-04-06 10:27 ` Update test suite for glass backend David Bremner 2016-04-06 10:27 ` [PATCH 1/3] test: improve error handling in lib-error tests David Bremner @ 2016-04-06 10:27 ` David Bremner 2016-04-06 10:27 ` [PATCH 3/3] test: cope with glass backend file naming variations David Bremner 2 siblings, 0 replies; 8+ messages in thread From: David Bremner @ 2016-04-06 10:27 UTC (permalink / raw) To: David Bremner, notmuch This should potentially be updated to have an equivalent optimization for the glass backend, but it in my unscientific tests, the glass backend without the optimization is faster then the chert backend with. --- test/atomicity.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/test/atomicity.py b/test/atomicity.py index 01a4205..1ca52b9 100644 --- a/test/atomicity.py +++ b/test/atomicity.py @@ -29,16 +29,19 @@ class RenameBreakpoint(gdb.Breakpoint): self.n = 0 def stop(self): - # As an optimization, only consider snapshots after a Xapian - # has really committed. Xapian overwrites record.base? as the - # last step in the commit, so keep an eye on their inumbers. - inodes = {} - for path in glob.glob('%s/.notmuch/xapian/record.base*' % maildir): - inodes[path] = os.stat(path).st_ino - if inodes == self.last_inodes: - # Continue - return False - self.last_inodes = inodes + xapiandir = '%s/.notmuch/xapian' % maildir + if os.path.isfile('%s/iamchert' % xapiandir): + # As an optimization, only consider snapshots after a + # Xapian has really committed. The chert backend + # overwrites record.base? as the last step in the commit, + # so keep an eye on their inumbers. + inodes = {} + for path in glob.glob('%s/record.base*' % xapiandir): + inodes[path] = os.stat(path).st_ino + if inodes == self.last_inodes: + # Continue + return False + self.last_inodes = inodes # Save a backtrace in case the test does fail backtrace = gdb.execute('backtrace', to_string=True) -- 2.8.0.rc3 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/3] test: cope with glass backend file naming variations 2016-04-06 10:27 ` Update test suite for glass backend David Bremner 2016-04-06 10:27 ` [PATCH 1/3] test: improve error handling in lib-error tests David Bremner 2016-04-06 10:27 ` [PATCH 2/3] test/atomicity: guard chert-only optimization David Bremner @ 2016-04-06 10:27 ` David Bremner 2016-04-07 13:57 ` Tomi Ollila 2 siblings, 1 reply; 8+ messages in thread From: David Bremner @ 2016-04-06 10:27 UTC (permalink / raw) To: David Bremner, notmuch In several places in the test suite we intentionally corrupt the Xapian database in order to test error handling. This corruption is specific to the on-disk organization of the database, and that changed with the glass backend. Hopefully introducing a new backend will be a relatively rare event, so that hardcoding the names of backends in the test suite is good enough. --- test/T050-new.sh | 2 +- test/T060-count.sh | 2 ++ test/T150-tagging.sh | 4 ++-- test/T360-symbol-hiding.sh | 4 ++-- test/T560-lib-error.sh | 10 ++++++++-- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/test/T050-new.sh b/test/T050-new.sh index 93a6fa9..fc93bfd 100755 --- a/test/T050-new.sh +++ b/test/T050-new.sh @@ -284,7 +284,7 @@ notmuch config set new.tags $OLDCONFIG test_begin_subtest "Xapian exception: read only files" -chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.DB +chmod u-w ${MAIL_DIR}/.notmuch/xapian/{*.DB,*.glass} output=$(NOTMUCH_NEW --debug 2>&1 | sed 's/: .*$//' ) chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.DB test_expect_equal "$output" "A Xapian exception occurred opening database" diff --git a/test/T060-count.sh b/test/T060-count.sh index 3fec94e..f1df4a2 100755 --- a/test/T060-count.sh +++ b/test/T060-count.sh @@ -96,6 +96,7 @@ 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" count=3 +dd if=/dev/zero of="${MAIL_DIR}/.notmuch/xapian/postlist.glass" 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" @@ -106,6 +107,7 @@ set breakpoint pending on break count_files commands shell cp /dev/null ${MAIL_DIR}/.notmuch/xapian/postlist.DB +shell cp /dev/null ${MAIL_DIR}/.notmuch/xapian/postlist.glass continue end run diff --git a/test/T150-tagging.sh b/test/T150-tagging.sh index 8adcabc..601d091 100755 --- a/test/T150-tagging.sh +++ b/test/T150-tagging.sh @@ -287,9 +287,9 @@ test_expect_code 1 "Empty tag names" 'notmuch tag + One' test_expect_code 1 "Tag name beginning with -" 'notmuch tag +- One' test_begin_subtest "Xapian exception: read only files" -chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.DB +chmod u-w ${MAIL_DIR}/.notmuch/xapian/{*.DB,*.glass} output=$(notmuch tag +something '*' 2>&1 | sed 's/: .*$//' ) -chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.DB +chmod u+w ${MAIL_DIR}/.notmuch/xapian/{*.DB,*.glass} test_expect_equal "$output" "A Xapian exception occurred opening database" test_done diff --git a/test/T360-symbol-hiding.sh b/test/T360-symbol-hiding.sh index 89e7f16..2ccdc63 100755 --- a/test/T360-symbol-hiding.sh +++ b/test/T360-symbol-hiding.sh @@ -15,11 +15,11 @@ test_begin_subtest 'running test' run_test mkdir -p ${PWD}/fakedb/.notmuch ( LD_LIBRARY_PATH="$TEST_DIRECTORY/../lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" \ $TEST_DIRECTORY/symbol-test ${PWD}/fakedb ${PWD}/nonexistent \ - 2>&1 | notmuch_dir_sanitize | sed "s,\`,\',g") > OUTPUT + 2>&1 | notmuch_dir_sanitize | sed -e "s,\`,\',g" -e 's,chert\|glass,foo,g') > OUTPUT cat <<EOF > EXPECTED A Xapian exception occurred opening database: Couldn't stat 'CWD/fakedb/.notmuch/xapian' -caught No chert database found at path 'CWD/nonexistent' +caught No foo database found at path 'CWD/nonexistent' EOF test_expect_equal_file EXPECTED OUTPUT diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh index 49d3674..7c5748b 100755 --- a/test/T560-lib-error.sh +++ b/test/T560-lib-error.sh @@ -189,7 +189,13 @@ Path already exists: MAIL_DIR EOF test_expect_equal_file EXPECTED OUTPUT -cat <<'EOF' > c_head +if [ -f "${MAIL_DIR}"/.notmuch/xapian/iamglass ]; then + db_ending=glass +else + db_ending=DB +fi + +cat <<EOF > c_head #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> @@ -210,7 +216,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", argv[1]); + path = talloc_asprintf (db, "%s/.notmuch/xapian/postlist.${db_ending}", argv[1]); fd = open(path,O_WRONLY|O_TRUNC); if (fd < 0) { fprintf (stderr, "error opening %s\n", argv[1]); -- 2.8.0.rc3 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] test: cope with glass backend file naming variations 2016-04-06 10:27 ` [PATCH 3/3] test: cope with glass backend file naming variations David Bremner @ 2016-04-07 13:57 ` Tomi Ollila 0 siblings, 0 replies; 8+ messages in thread From: Tomi Ollila @ 2016-04-07 13:57 UTC (permalink / raw) To: David Bremner, David Bremner, notmuch On Wed, Apr 06 2016, David Bremner <david@tethera.net> wrote: > In several places in the test suite we intentionally corrupt the Xapian > database in order to test error handling. This corruption is specific to > the on-disk organization of the database, and that changed with the > glass backend. Hopefully introducing a new backend will be a relatively > rare event, so that hardcoding the names of backends in the test suite > is good enough. > --- > test/T050-new.sh | 2 +- > test/T060-count.sh | 2 ++ > test/T150-tagging.sh | 4 ++-- > test/T360-symbol-hiding.sh | 4 ++-- > test/T560-lib-error.sh | 10 ++++++++-- > 5 files changed, 15 insertions(+), 7 deletions(-) > > diff --git a/test/T050-new.sh b/test/T050-new.sh > index 93a6fa9..fc93bfd 100755 > --- a/test/T050-new.sh > +++ b/test/T050-new.sh > @@ -284,7 +284,7 @@ notmuch config set new.tags $OLDCONFIG > > > test_begin_subtest "Xapian exception: read only files" > -chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.DB > +chmod u-w ${MAIL_DIR}/.notmuch/xapian/{*.DB,*.glass} if either of these is missing, bash will by default expand like .../.notmuch/xapian/*.DB or .../.notmuch/xapian/*.glass shopt -s nullglob could be added to remove this expansion (and make chmod not yell on error) > output=$(NOTMUCH_NEW --debug 2>&1 | sed 's/: .*$//' ) > chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.DB Why here the same expansion as above is not done ? > test_expect_equal "$output" "A Xapian exception occurred opening database" > diff --git a/test/T060-count.sh b/test/T060-count.sh > index 3fec94e..f1df4a2 100755 > --- a/test/T060-count.sh > +++ b/test/T060-count.sh > @@ -96,6 +96,7 @@ 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" count=3 > +dd if=/dev/zero of="${MAIL_DIR}/.notmuch/xapian/postlist.glass" 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" > @@ -106,6 +107,7 @@ set breakpoint pending on > break count_files > commands > shell cp /dev/null ${MAIL_DIR}/.notmuch/xapian/postlist.DB > +shell cp /dev/null ${MAIL_DIR}/.notmuch/xapian/postlist.glass > continue > end > run > diff --git a/test/T150-tagging.sh b/test/T150-tagging.sh > index 8adcabc..601d091 100755 > --- a/test/T150-tagging.sh > +++ b/test/T150-tagging.sh > @@ -287,9 +287,9 @@ test_expect_code 1 "Empty tag names" 'notmuch tag + One' > test_expect_code 1 "Tag name beginning with -" 'notmuch tag +- One' > > test_begin_subtest "Xapian exception: read only files" > -chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.DB > +chmod u-w ${MAIL_DIR}/.notmuch/xapian/{*.DB,*.glass} nullglob again > output=$(notmuch tag +something '*' 2>&1 | sed 's/: .*$//' ) > -chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.DB > +chmod u+w ${MAIL_DIR}/.notmuch/xapian/{*.DB,*.glass} Here you've done that same expansion :D > test_expect_equal "$output" "A Xapian exception occurred opening database" > > test_done > diff --git a/test/T360-symbol-hiding.sh b/test/T360-symbol-hiding.sh > index 89e7f16..2ccdc63 100755 > --- a/test/T360-symbol-hiding.sh > +++ b/test/T360-symbol-hiding.sh > @@ -15,11 +15,11 @@ test_begin_subtest 'running test' run_test > mkdir -p ${PWD}/fakedb/.notmuch > ( LD_LIBRARY_PATH="$TEST_DIRECTORY/../lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" \ > $TEST_DIRECTORY/symbol-test ${PWD}/fakedb ${PWD}/nonexistent \ > - 2>&1 | notmuch_dir_sanitize | sed "s,\`,\',g") > OUTPUT > + 2>&1 | notmuch_dir_sanitize | sed -e "s,\`,\',g" -e 's,chert\|glass,foo,g') > OUTPUT > > cat <<EOF > EXPECTED > A Xapian exception occurred opening database: Couldn't stat 'CWD/fakedb/.notmuch/xapian' > -caught No chert database found at path 'CWD/nonexistent' > +caught No foo database found at path 'CWD/nonexistent' > EOF > test_expect_equal_file EXPECTED OUTPUT > > diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh > index 49d3674..7c5748b 100755 > --- a/test/T560-lib-error.sh > +++ b/test/T560-lib-error.sh > @@ -189,7 +189,13 @@ Path already exists: MAIL_DIR > EOF > test_expect_equal_file EXPECTED OUTPUT > > -cat <<'EOF' > c_head > +if [ -f "${MAIL_DIR}"/.notmuch/xapian/iamglass ]; then > + db_ending=glass > +else > + db_ending=DB > +fi > + > +cat <<EOF > c_head > #include <stdio.h> > #include <sys/types.h> > #include <sys/stat.h> > @@ -210,7 +216,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", argv[1]); > + path = talloc_asprintf (db, "%s/.notmuch/xapian/postlist.${db_ending}", argv[1]); > fd = open(path,O_WRONLY|O_TRUNC); > if (fd < 0) { > fprintf (stderr, "error opening %s\n", argv[1]); > -- > 2.8.0.rc3 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > https://notmuchmail.org/mailman/listinfo/notmuch ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] WIP: update test suite for glass xapian backend 2016-04-05 11:18 WIP: update for xapian 1.3.5 David Bremner 2016-04-05 11:18 ` [PATCH 1/2] test: improve error handling in lib-error tests David Bremner @ 2016-04-05 11:18 ` David Bremner 1 sibling, 0 replies; 8+ messages in thread From: David Bremner @ 2016-04-05 11:18 UTC (permalink / raw) To: notmuch This fixes all but one of the test failures I found with xapian 1.3.5. Once I see what the real issue is with the atomicity test, I'll see how to organize this. In particular it might make sense to define a global variable in test-lib.sh for what the default xapian backend will be. --- test/T050-new.sh | 2 +- test/T060-count.sh | 2 ++ test/T150-tagging.sh | 4 ++-- test/T360-symbol-hiding.sh | 4 ++-- test/T560-lib-error.sh | 10 ++++++++-- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/test/T050-new.sh b/test/T050-new.sh index 93a6fa9..fc93bfd 100755 --- a/test/T050-new.sh +++ b/test/T050-new.sh @@ -284,7 +284,7 @@ notmuch config set new.tags $OLDCONFIG test_begin_subtest "Xapian exception: read only files" -chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.DB +chmod u-w ${MAIL_DIR}/.notmuch/xapian/{*.DB,*.glass} output=$(NOTMUCH_NEW --debug 2>&1 | sed 's/: .*$//' ) chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.DB test_expect_equal "$output" "A Xapian exception occurred opening database" diff --git a/test/T060-count.sh b/test/T060-count.sh index 3fec94e..f1df4a2 100755 --- a/test/T060-count.sh +++ b/test/T060-count.sh @@ -96,6 +96,7 @@ 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" count=3 +dd if=/dev/zero of="${MAIL_DIR}/.notmuch/xapian/postlist.glass" 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" @@ -106,6 +107,7 @@ set breakpoint pending on break count_files commands shell cp /dev/null ${MAIL_DIR}/.notmuch/xapian/postlist.DB +shell cp /dev/null ${MAIL_DIR}/.notmuch/xapian/postlist.glass continue end run diff --git a/test/T150-tagging.sh b/test/T150-tagging.sh index 8adcabc..601d091 100755 --- a/test/T150-tagging.sh +++ b/test/T150-tagging.sh @@ -287,9 +287,9 @@ test_expect_code 1 "Empty tag names" 'notmuch tag + One' test_expect_code 1 "Tag name beginning with -" 'notmuch tag +- One' test_begin_subtest "Xapian exception: read only files" -chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.DB +chmod u-w ${MAIL_DIR}/.notmuch/xapian/{*.DB,*.glass} output=$(notmuch tag +something '*' 2>&1 | sed 's/: .*$//' ) -chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.DB +chmod u+w ${MAIL_DIR}/.notmuch/xapian/{*.DB,*.glass} test_expect_equal "$output" "A Xapian exception occurred opening database" test_done diff --git a/test/T360-symbol-hiding.sh b/test/T360-symbol-hiding.sh index 89e7f16..2ccdc63 100755 --- a/test/T360-symbol-hiding.sh +++ b/test/T360-symbol-hiding.sh @@ -15,11 +15,11 @@ test_begin_subtest 'running test' run_test mkdir -p ${PWD}/fakedb/.notmuch ( LD_LIBRARY_PATH="$TEST_DIRECTORY/../lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" \ $TEST_DIRECTORY/symbol-test ${PWD}/fakedb ${PWD}/nonexistent \ - 2>&1 | notmuch_dir_sanitize | sed "s,\`,\',g") > OUTPUT + 2>&1 | notmuch_dir_sanitize | sed -e "s,\`,\',g" -e 's,chert\|glass,foo,g') > OUTPUT cat <<EOF > EXPECTED A Xapian exception occurred opening database: Couldn't stat 'CWD/fakedb/.notmuch/xapian' -caught No chert database found at path 'CWD/nonexistent' +caught No foo database found at path 'CWD/nonexistent' EOF test_expect_equal_file EXPECTED OUTPUT diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh index 49d3674..7c5748b 100755 --- a/test/T560-lib-error.sh +++ b/test/T560-lib-error.sh @@ -189,7 +189,13 @@ Path already exists: MAIL_DIR EOF test_expect_equal_file EXPECTED OUTPUT -cat <<'EOF' > c_head +if [ -f "${MAIL_DIR}"/.notmuch/xapian/iamglass ]; then + db_ending=glass +else + db_ending=DB +fi + +cat <<EOF > c_head #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> @@ -210,7 +216,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", argv[1]); + path = talloc_asprintf (db, "%s/.notmuch/xapian/postlist.${db_ending}", argv[1]); fd = open(path,O_WRONLY|O_TRUNC); if (fd < 0) { fprintf (stderr, "error opening %s\n", argv[1]); -- 2.8.0.rc3 ^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2016-04-07 13:57 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-04-05 11:18 WIP: update for xapian 1.3.5 David Bremner 2016-04-05 11:18 ` [PATCH 1/2] test: improve error handling in lib-error tests David Bremner 2016-04-06 10:27 ` Update test suite for glass backend David Bremner 2016-04-06 10:27 ` [PATCH 1/3] test: improve error handling in lib-error tests David Bremner 2016-04-06 10:27 ` [PATCH 2/3] test/atomicity: guard chert-only optimization David Bremner 2016-04-06 10:27 ` [PATCH 3/3] test: cope with glass backend file naming variations David Bremner 2016-04-07 13:57 ` Tomi Ollila 2016-04-05 11:18 ` [PATCH 2/2] WIP: update test suite for glass xapian backend David Bremner
Code repositories for project(s) associated with this public inbox https://yhetil.org/notmuch.git/ This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).