aboutsummaryrefslogtreecommitdiff
path: root/test/T566-lib-message.sh
AgeCommit message (Collapse)Author
2023-07-21test: support testing notmuch as installedDavid Bremner
We put some effort into testing the built copy rather than some installed copy. On the other hand for people like packagers, testing the installed copy is also of interest. When NOTMUCH_TEST_INSTALLED is set to a nonempty value, tests do not require a built notmuch tree or running configure. Some of the tests marked as broken when running against installed notmuch are probably fixable.
2022-12-27lib/message: move xapian call inside try/catch block in _n_m_deleteDavid Bremner
The call to delete_document can throw exceptions (and can happen in practice [1]), so catch the exception and extract the error message. As a side effect, also move the call to _n_m_has_term inside the try/catch. This should not change anything as that function already traps any Xapian exceptions. [1]: id:wwuk039sk2p.fsf@chaotikum.eu
2022-12-27test: add known broken test for exception handling in _n_m_deleteDavid Bremner
In [1], Thomas Schneider reported an uncaught Xapian exception when running out of disk space. We generate the same exception via database corruption. [1]: id:wwuk039sk2p.fsf@chaotikum.eu
2022-06-25lib: check for writable db in n_m_tags_maildir_flagsDavid Bremner
The database needs to be writable because the list of stored file names will change in general.
2022-06-25lib: add NOTMUCH_STATUS_CLOSED_DATABASE, use in _n_d_ensure_writableDavid Bremner
In order for a database to actually be writeable, it must be the case that it is open, not just the correct type of Xapian object. By explicitely checking, we are able to provide better error reporting, in particular for the previously broken test in T566-lib-message.
2022-06-25test: error handling for n_m_tags_to_maildir_flagsDavid Bremner
The closed database case should fail gracefully, but currently it segfaults.
2022-06-25test: error handling in _n_message_{add,remove}_filenameDavid Bremner
Use a closed database to force throwing a Xapian exception. Leave the check vague to accomodate a potential explicit check for open database.
2022-06-25test: _notmuch_message_remove_term catches exceptions.David Bremner
Unfortunately we can't differentiate between the two distinct error conditions for Document::remove_term.
2022-06-25lib/message: catch exceptions in _n_m_add_termDavid Bremner
Some code movement is needed to make sure the cache is only invalidated when the Xapian operation succeeds.
2022-05-29test: replace deprecated use of notmuch_database_open_verboseDavid Bremner
We need to do it some day, and it is a bit annoying to read deprecation messages in broken tests.
2021-12-04test: move system includes to notmuch-test.hDavid Bremner
This removes some redudant includes, and will also make it easier to introduce "#define _GNU_SOURCE", which must come before all system includes.
2021-03-12test: clean up some extra whitespace.David Bremner
The extra space is mainly just untidy.
2020-08-03test: regression test for n_m_get_filenamesDavid Bremner
Closing the database after the iterator is created is not a problem.
2020-08-03test: split header for lib-message tests.David Bremner
This allows finer control over when to close the database.
2020-07-31test: add regression tests for n_thread_get_toplevel_messagesDavid Bremner
Include a test for the previously omitted non-trivial code path for notmuch_thread_get_replies.
2020-07-29test: move notmuch_message_* tests to their own fileDavid Bremner
This is for consistency with the recently added tests for notmuch_database_*.