aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-08-09emacs: Closing parenthesis go on the same lineJonas Bernoulli
2020-08-09emacs: Fix indentationJonas Bernoulli
2020-08-09emacs: Remove excess empty linesJonas Bernoulli
Most people who write lots of lisp tend to only sparsely use empty "separator" lines within forms. In lisp they feel unnecessary and since most files stick to this convention we get a bit confused when there are extra empty lines. It feels like the s-expressions are falling into pieces. All of this is especially true between a function's doc-string and body because the doc-string is colored differently, which visually already separates it quite sufficiently from the code that follows.
2020-08-09emacs: Shorten long linesJonas Bernoulli
2020-08-08Emacs: Ensure left-to-right display for message headersTeemu Likonen
In notmuch-show buffer insert invisible U+200E LEFT-TO-RIGHT MARK character at the beginning of message header paragraph if the From header contains a right-to-left character. This ensures that the header paragraph is always rendered in left-to-right mode. See Emacs Lisp reference manual section "(elisp) Bidirectional Display" for more info.
2020-08-08T355: specify hash algorithm explicitlyĐoàn Trần Công Danh
On some systems (notably, the one shipped with LibreSSL), default fingerprint digest algorithm is SHA256. On other systems, users can change default digest algorithm by changing default_md in /etc/ssl/default_md. Let's ask openssl to provide us specific algorithm to make the test more deterministic. Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-08-08configure: drop check for default xapian backendĐoàn Trần Công Danh
Starting from xapian 1.3.5, xapian switched default backend to glass. From 00cdfe10 (build: drop support for xapian versions less than 1.4, 2020-04-22), we only support xapian 1.4.0+. Effectively, we don't need to check for default xapian backend anymore. Further more, from 99a7aac8 (test: drop use of db_ending, 2020-07-29), our test framework has become independence from default xapian. Let's drop it. Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-08-08configure: check for pytest with python -m pytestĐoàn Trần Công Danh
On different distro, pytest is suffixed with different patterns. On the other hand, `python3-pytest' could be invoked correctly, via `python3 -m pytest', the latter is used by our tests, now. Switch to `$python -m pytest` to fix address all incompatible naming. Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-08-03test: regression tests for n_indexopts_{get,set}_decrypt_policyDavid Bremner
The main criteria is that they don't crash. Working with a closed database is a bonus.
2020-08-03test: regression test for traversing config list with closed dbDavid Bremner
Also mention error return in API docs
2020-08-03test: regression test for n_d_get_config_list on closed db.David Bremner
Exception is caught.
2020-08-03test: regression test for n_directory_{get,set}_mtimeDavid Bremner
The mtime is cached, so closing the db is not a problem. Writing the mtime throws an exception, which is caught.
2020-08-03lib: fix return value for n_directory_deleteDavid Bremner
Falling out of the catch meant the error return was lost
2020-08-03test: known broken test for n_directory_delete with closed db.David Bremner
There is a return value bug in notmuch_directory_delete that is hiding the exception.
2020-08-03lib: catch exceptions in n_directory_get_child_filesDavid Bremner
Also clarify API in error case.
2020-08-03test: add known broken test for n_directory_get_child_filesDavid Bremner
This is a clone of the one for get_child_directories
2020-08-03lib: catch exceptions in n_directory_get_child_directoriesDavid Bremner
Also clarify API in error case.
2020-08-03test: add known broken test for n_directory_get_child_directoriesDavid Bremner
Start a new test file (for the notmuch_directory_* API group) to hold this test.
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-08-03test: add regression test for n_messages_collect_tagsDavid Bremner
Also test n_messages_destroy.
2020-08-03lib: return NULL from n_d_get_default_indexopts on errorDavid Bremner
This is a rare and probably serious programming error, so better not to silently return a default value.
2020-08-03build: upload html docs as part of release processDavid Bremner
Use a URL https://notmuchmail.org/doc/latest to leave room for a future more ambitious scheme deploying multiple versions. This also forces the html docs to built as part of the release process. In the future this should be updated to tolerate generating a release without sphinx installed. This needs a new target analogous to build-info and build-man that does nothing if sphinx is not installed.
2020-08-01test: drop use of db_endingDavid Bremner
This will allow the dropping of the test for the default ending from configure.
2020-07-31test: drop NOTMUCH_DEFAULT_XAPIAN_BACKEND from T360-symbol-testDavid Bremner
Inspired by the suggestion of id:20200727154108.16269-3-congdanhqx@gmail.com to drop the configuration test for the default backend. This version is hopefully robust against backend changes.
2020-07-31test: destroy thread from closed databaseDavid Bremner
Check for (non)-crash.
2020-07-31test: regression test for n_thread_get_tagsDavid Bremner
Code is taken from the API docs, with the twist that the underlying database is closed. Not crashing is the main point.
2020-07-31test: add regression tests for oldest and newest datesDavid Bremner
These are strictly to watch for crashes, so don't be too fussy about the actual timestamps.
2020-07-31test: add regression tests for n_t_get_{authors, subject}David Bremner
This is returning explicitely cached data, so no database access is needed.
2020-07-31test: add regression test for n_t_get_messagesDavid Bremner
This is similar to the case of toplevel messages. Currently everything is cached, so no database access is necessary. This might change in the future, but it should not crash in either case.
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-31test: add regression test for n_thread_get_total_{messages,files}David Bremner
This is returning cached info, so does not need to access the (closed) database.
2020-07-31test: regression test for n_t_get_thread_idDavid Bremner
This is just cached data, so as long as we don't prematurely free anything, it should be fine.
2020-07-29test: regression test for notmuch_query_destroyDavid Bremner
As with other void API entries, not crashing counts as success.
2020-07-29test: regression tests for n_q_count_{messages, threads}David Bremner
At least these exceptions are caught.
2020-07-29test: regression test for n_q_search_messagesDavid Bremner
Exception handling matches notmuch_query_search_threads, at least for this case.
2020-07-29test: regression test for n_q_search_threadsDavid Bremner
At least this exception is caught.
2020-07-29test: add regression test for n_q_add_tag_excludeDavid Bremner
This relies on the change to not tear down the auxilary Xapian objects, in particular the query parser, when the database is closed.
2020-07-29test: regression test for n_q_{set, get}_sortDavid Bremner
We just want to make sure accessing the query owned by a closed db does not cause a crash.
2020-07-29test: regression test for set_omit_excludedDavid Bremner
2020-07-29test: regression test for notmuch_query_get_databaseDavid Bremner
Current functionality is too trivial to really justify a test, but it's simpler just to test the complete API.
2020-07-29test: add regression test for n_q_{create,_get_query_string}David Bremner
Start a new file of tests, to keep to the (emerging) scheme of one notmuch_foo group per file
2020-07-29test: move notmuch_message_* tests to their own fileDavid Bremner
This is for consistency with the recently added tests for notmuch_database_*.
2020-07-28lib: replace use of static_cast for writable databasesDavid Bremner
static_cast is a bit tricky to understand and error prone, so add a second pointer to (potentially the same) Xapian database object that we know has the right subclass.
2020-07-28lib: encapsulate the use of notmuch_database_t field 'mode'David Bremner
The plan is to change the underlying representation.
2020-07-28lib: drop two gratuitous assignments to database modeDavid Bremner
I'm not sure what the point of modifying that right before destroying the object is. In a future commit I want to remove that element of the object, so simplify that task.
2020-07-28test: Explicitly state that we want to sign with senderJonas Bernoulli
Since Emacs 27 'mml-secure-epg-sign' errors out if we don't opt-in to signing as the sender using 'mml-secure-openpgp-sign-with-sender'.
2020-07-28test: Remove misguided emacs testing utilitiesJonas Bernoulli
The goal of this abstraction was to save space. But that failed as the result actually was that four trivial lines got replace with 15 fairly complicated lines. The opposite of what it was supposed to do. Also it made it harder to come up with the fix in the previous commit; simply grepping for the relevant symbols did not work because they get constructed at run-time instead of appearing in the source file.
2020-07-28test: Deal with Emacs 27 switching to lexical scope by defaultJonas Bernoulli
Starting with Emacs 27 undeclared variables in evaluated interactive code uses lexical scope. This includes code passed with '--eval' as we do in the Emacs tests, which also happen to assume dynamic scope. - This can affect variables defined by libraries that we use. We let-bind such variables to change the behavior of functions which we then call with these bindings in effect. If these libraries are not loaded beforehand, then the bindings are lexical and fail to have the effect we intended. At this time only 'smtpmail' has to be loaded explicitly (for the variables let-bound in emacs_deliver_message and emacs_fcc_message). 'message' doesn't have to be loaded explicitly, because loading 'notmuch' (in 'run_emacs') already takes care of that, indirectly. - Our own testing-only variables also have to be declared explicitly. We should have done that anyway, but because of how and where these variables are used it was very easy to overlook that (i.e. it isn't something the byte-compiler ever looks at). Not so in Emacs 27 anymore; here this oversight caused four tests to fail. The numeric values of these variables get incremented by functions that we add to hooks that are run by many tests, not just the tests where we actually inspect the value and therefore take care to let- bind the values to 0 before we begin. The global values therefore have to be numeric values as well. I have chosen -100 instead of 0 as the default in case someone writes a test that inspects the value but forgets to let-bind the value. I hope that the unusual negative value that one is going to see in such a case will help debugging the issue.
2020-07-28gitignore: Ignore generated sphinx.configJonas Bernoulli