summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2021-09-30Merge tag '0.33.2'David Bremner
notmuch 0.33.2 release
2021-09-29test/T355-smime: Use key as exported by gpgsmDavid Bremner
As reported in id:87h7pxiek3.fsf@tethera.net, the previous version of the test is flaky. There is some so-far undebugged interaction between openssl and gpgsm that causes the keys to fail to import. As a potential workaround, use the key as exported by gpgsm, and eliminate openssl from this particular pipeline.
2021-09-11test/emacs: tests for notmuch-{tree,unthreaded} with bad CWDDavid Bremner
These work thanks to the previous wrapping of process creation primitives.
2021-09-11emacs: wrap call-processDavid Bremner
Provide safe working directory
2021-09-11test/emacs: test for notmuch-show with nonexistent CWDDavid Bremner
Somewhat predictably, the other code path in notmuch-call-notmuch--helper also needs to be fixed.
2021-09-11emacs: wrap make-processDavid Bremner
Provide a safe working directory.
2021-09-11test/emacs: test for notmuch-search with nonexistent CWDDavid Bremner
(At least) notmuch-start-notmuch needs to be updated to set a safe working directory.
2021-09-11emacs: wrap call-process-regionDavid Bremner
As with notmuch--process-lines, initial purpose is to provide a safe binding for default-directory. This is enough to make notmuch-hello robust against non-existent or corrupt values default-directory, but probably not other views.
2021-09-11test/emacs: run notmuch-hello with a nonexisting default dirDavid Bremner
This replicates the problem reported in Debian bug #922536.
2021-09-11test/emacs: provide macro test-log-errorDavid Bremner
Because of the way emacs reports errors, a test form can crash and not change the main buffer. To work around this, capture both signalled errors and any other messages.
2021-09-10Merge tag '0.33.1'David Bremner
notmuch 0.33.1 release
2021-09-10lib: use 'localhost' rather than fqdn for default mail address.David Bremner
As discussed in the thread starting at [1], the fully qualified domain name is a bit tricky to get reproducibly, might reveal information people prefer to keep private, and somewhat unlikely to provide reliable mail routing. The new approach of $current_username@localhost is better for the first two considerations, and probably at least as good as a test mail address. [1]: id:87sfyibqhj.fsf@tethera.net
2021-09-08test/emacs: test for functions in notmuch-search-result-format.David Bremner
Based on the commit message in id:20210221151902.2301690-3-dme@dme.org Add the function notmuch-test-result-flags to test-lib.el to avoid repeating it in 3 T*.sh files.
2021-09-04CLI/tag: enable sexp queriesDavid Bremner
We have to rewrite _optimize_tag_query here because it is generating a query string in the infix Xapian syntax. Luckily this is easy to do with the sexp query syntax.
2021-09-04CLI/{count, dump, reindex, reply, show}: enable sexp queriesDavid Bremner
The change in each case is to call notmuch_query_create_with_syntax, relying on the already inherited shared options. As a bonus we get improved error handling from the new query creation API. The remaining subcommand is 'tag', which is a bit trickier.
2021-09-04lib/parse-sexp: apply macrosDavid Bremner
Macros implement lazy evaluation and lexical scope. The former is needed to make certain natural constructs work sensibly (e.g. (tag ,param)) but the latter is mainly future-proofing in case the DSL is is extended to allow local bindings. For technical background, see chapters 6 and 17 of [1] (or some other intermediate programming languages textbook). [1] http://cs.brown.edu/courses/cs173/2012/book/
2021-09-04lib/parse-sexp: support saved s-expression queriesDavid Bremner
It turns out there is not really much code in query-fp.cc useful for supporting the new syntax. The code we could potentially factor out amounts to calling notmuch_database_get_config; both the key construction and the parsing of the results are specific to the query syntax involved.
2021-09-04CLI/config support saving s-expression queriesDavid Bremner
This commit does not enable using saved s-expression queries, only saving and retrieving them from the config file or the database. Use in queries will be enabled in a following commit.
2021-09-04lib/parse-sexp: handle saved queriesDavid Bremner
This provides functionality analogous to query: in the Xapian QueryParser based parser. Perhaps counterintuitively, the saved queries currently have to be in the original query syntax (i.e. not s-expressions).
2021-09-04lib/parse-sexp: parse user headersDavid Bremner
One subtle aspect is the replacement of _find_prefix with _notmuch_database_prefix, which understands user headers. Otherwise the code mainly consists of creating a fake prefix record (since the user prefixes are not in the prefix table) and error handling.
2021-09-04lib/parse-sexp: support infix subqueriesDavid Bremner
This is necessary so that programs can take infix syntax queries from a user and use the sexp query syntax to construct e.g. a refinement of that query.
2021-09-04lib/parse-sexp: expand queriesDavid Bremner
The code here is just gluing together _notmuch_query_expand with the existing sexp parser infrastructure.
2021-09-04lib/parse-sexp: support regular expressionsDavid Bremner
At least to the degree that the Xapian QueryParser based parser also supports them. Support short alias 'rx' as it seems to make more complex queries nicer to read.
2021-09-04lib/query: generalize exclude handling to s-expression queriesDavid Bremner
In fact most of the code path is in common, only the caching of terms in the query needs to be added for s-expression queries.
2021-09-04lib/parse-sexp: handle unprefixed terms.David Bremner
This is equivalent to adding the same field name "" for multiple prefixes in the Xapian query parser, but we have to explicitely construct the resulting query.
2021-09-04lib/parse-sexp: add '*' as syntactic sugar for '(starts-with "")'David Bremner
Users that insist on using a literal '*' as a tag, can continue to do so by quoting it when searching.
2021-09-04lib/parse-sexp: 'starts-with' wildcard searchesDavid Bremner
The many tests potentially overkill, but they could catch typos in the prefixes table. As a simplifying assumption, for now we assume a single argument to the wildcard operator, as this matches the Xapian semantics. The name 'starts-with' is chosen to emphasize the supported case of wildcards in currrent (1.4.x) Xapian.
2021-09-04lib/parse-sexp: add term prefix backed fieldsDavid Bremner
We use "boolean" to describe fields that should generate terms literally without stemming or phrase splitting. This terminology might not be ideal but it is already enshrined in notmuch-search-terms(7).
2021-09-04lib/parse-sexp: support phrase queries.David Bremner
Anything that is quoted or not purely word characters is considered a phrase. Phrases are not stemmed, because the stems do not have positional information in the database. It is less efficient to scan the term twice, but it avoids a second pass to add prefixes, so maybe it balances out. In any case, it seems unlikely query parsing is very often a bottleneck.
2021-09-04lib/parse-sexp: support subject fieldDavid Bremner
The broken tests are because we do not yet handle phrase searches.
2021-09-04lib/parse-sexp: support and, not, and or.David Bremner
All operations and (Xapian) fields will eventually have an entry in the prefixes table. The flags field is just a placeholder for now, but will eventually distinguish between various kinds of prefixes.
2021-09-04lib/parse-sexp: stem unquoted atomsDavid Bremner
This is somewhat less DWIM than the Xapian query parser, but it has the advantage of simplicity.
2021-09-04lib/parse-sexp: parse single terms and the empty list.David Bremner
There is not much of a parser here yet, but it already does some useful error reporting. Most functionality sketched in the documentation is not implemented yet; detailed documentation will follow with the implementation.
2021-09-04CLI/search+address: support sexpr queriesDavid Bremner
Initially support selection of query syntax in two subcommands to enable testing.
2021-09-04configure: optional library sfsexpDavid Bremner
The configure part is essentially the same as the other checks using pkg-config. Since the optional inclusion of this feature changes what options are available to the user, include it in the "built_with" pseudo-configuration keys.
2021-09-04CLI: make variable n_requested_db_uuid file scope.David Bremner
It turns out that now that we pass an open database into the subcommands, it is easy to check any requested uuid against the database at the same time as we process the other shared arguments. This results in overall less boilerplate code, as well as making a CLI scope function and variable file scope in notmuch.c.
2021-08-30test: known broken test for emacs display of message/rfc822 partsDavid Bremner
There are at least 3 bugs present. 1) notmuch-show-insert-part-message/rfc822 assumes that message/rfc822 parts will have a ":content" property, but that turns out not to be the case. 2) something deep in gnus wants gnus-newsgroup-charset, but that is defined in gnus-sum, which is not loaded by default. 3) If gnus-sum is loaded, then the display of the message/rfc822 part succeeds, but the buffer gets put into gnus-article-mode, which means that, inter alia, notmuch text properties and keybindings get wiped.
2021-08-30test/crypto: test message with rfc822 attachment.David Bremner
This is intended to help track down a display problem in the emacs front end
2021-08-29lib: consider all instances of Delivered-To headerHannu Hartikainen
When using notmuch-reply and guessing the From: address from Delivered-To headers, I had the wrong address chosen today. This was because the messages from the notmuch list contain these headers in this order: Delivered-To: hannu.hartikainen@gmail.com ... Delivered-To: hannu@hrtk.in In my .notmuch-config I have the following configuration: primary_email=hannu@hrtk.in other_email=hannu.hartikainen@gmail.com;... Before this change, notmuch-reply would guess From: @gmail.com because that is the first Delivered-To header present. After the change, the primary address is chosen as I would expect.
2021-08-29reply: add test for multiple Delivered-To headersHannu Hartikainen
Add a known broken subtest for guessing From: correctly when there are multiple Delivered-To: headers. The address configured as primary_email should get picked.
2021-08-22CLI: define and use format version 5David Bremner
This is a bit of a cheat, since the format does not actually change. On the other hand it is fairly common to do something like this to shared libary SONAMEs when the ABI changes in some subtle way. It does rely on the format-version argument being early enough on the command line to generate a sensible error message.
2021-08-21test/path-config: use test_expect_equal_file_nonemptyDavid Bremner
This is more robust against crashes when the expected output is also generated by notmuch. In the case where the expected output is explicit, it seems like overkill.
2021-08-21test: add test_expect_equal_file_nonemptyDavid Bremner
A common bug in tests is that the code used to generate the EXPECTED file fails, generating no output. When the code generating the OUTPUT file fails in the same way, the test passes, even though there is a failure being hidden. Add a new test function that guards against this.
2021-08-21test: factor out test_diff_file_David Bremner
A following commit will use this new function in a public test function.
2021-08-21test/expect_equal_file: whitespace cleanupDavid Bremner
No functional change, just reindent to Emacs defaults.
2021-08-18Merge tag 'debian/0.32.3-1'David Bremner
notmuch release 0.32.3-1 for unstable (sid) [dgit] [dgit distro=debian no-split --quilt=linear]
2021-08-17CLI/config: restore "notmuch config get built_with.*"David Bremner
We need to special case the config section "built_with" because it is not (currently) handled by the library. This seems consist with the other sub-sub-commands 'list' and 'set'.
2021-08-17test/config: add tests for built_withDavid Bremner
The "get" test is known broken because this functionality was dropped during the 0.32 config rewrite.
2021-08-17lib/open: look in MAILDIR for database, as documented.David Bremner
This fixes the bug id:87bl9lx864.fsf@kisara.moe
2021-08-17test: add known broken tests for finding database via MAILDIRDavid Bremner
This highlights a bug reported by several users, including Mohsin Kaleem [1]. The inconsistent use of test_begin_subtest_known_broken is because some of these tests pass even though the database cannot be located. This problem is left for a future commit. [1]: id:87bl9lx864.fsf@kisara.moe