summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2014-11-09cli: notmuch address option defaults updateTomi Ollila
When no --output option were given, change default to display senders only. When only --count option is given, display senders (in contrary to not displaying anything). Document that --count with --sort=**order** is not supported option combination. Clean up some whitespace in the documentation. One test updated to have --output=count without sender nor recipient output option.
2014-11-05cli: address: Add --output=countMichal Sojka
This output prints how many times was each address encountered during search.
2014-11-05cli: address: Do not output duplicate addressesMichal Sojka
This filters out duplicate addresses from address command output. It also also adds tests for the address command. The code here is an extended version of a patch from Jani Nikula.
2014-11-02test: Make gen-threads work with python3Jesse Rosenthal
python3 doesn't allow dictionaries to be initialized with non-string keywords. This presents problems on systems in which "python" means "python3". We instead initalize the dictionary using the dict comprehension and then update it with the values from the tree. This will work with both python2 and python3.
2014-11-02test: add tests for --output=messages --duplicate=NJani Nikula
Basic smoke tests for the feature, nothing fancy.
2014-11-01cli: Add support for parsing keyword-flag argumentsJani Nikula
This allows having multiple --foo=bar --foo=baz options on the command line, with the corresponding values OR'd together. [Test added by Michal Sojka]
2014-10-31test: use LDFLAGS in test/Makefile.localJani Nikula
Apparently the test binaries are built with minimal LDFLAGS, only adding dependency specific LDFLAGS as needed. However because some of the test binaries incorporate notmuch object files, it is necessary to use the same link flags as notmuch. For example user provided CFLAGS/CXXFLAGS/LDFLAGS with -fsanitize=undefined fails to build the test binaries if the flags differ.
2014-10-28test: add simple tests for post-insert hookDavid Bremner
Most of the existing tests for pre/post-new hook don't seem to apply.
2014-10-25test: Test upgrade to ghost messages featureAustin Clements
2014-10-25lib: Enable ghost messages featureAustin Clements
This fixes the broken thread order test.
2014-10-25Merge tag '0.18.2_rc1'David Bremner
notmuch 0.18.2~rc1 release Conflicts: NEWS debian/changelog
2014-10-25test: kill '"filename": "signature.asc"' from json outputDavid Bremner
This starts to appear with emacs24.4, so we can't easily have it in our expected output.
2014-10-25test/emacs: force *Messages* buffer to be writableDavid Bremner
In emacs 24.4 the messages buffer starts being read-only, which kills these tests. This seems to be the point of the variable inihibit-read-only, which has existed at least since emacs 21.
2014-10-25test: simplify T360-symbol-hiding, use nm instead of objdumpDavid Bremner
After yet another variation in objdump output caused this test to fail (on a Debian port, no less), I decided whatever putative benefit we get from looking at the object files instead of the library isn't worth the maintenence headache. This version uses nm -P. nm -P should be portable, and fixed format. It purposely doesn't use the -D argument, since that is non-POSIX and nm on GNU/Linux seems do the right thing without it. It still won't work out of the box on e.g. Mac OS/X. I think the right thing to do there is to move some more configuration information into sh.config. (cherry picked from commit c34d6bad0f9da300eac2181e2073aee130432932)
2014-10-25test: Port atomicity test to PythonAustin Clements
Previously, this was implemented using a horrible GDB script (because there is no such thing as a non-horrible GDB script). This GDB script often broke with newer versions of GDB for mysterious reasons. Port the test script to GDB's Python API, which makes the code much cleaner and, hopefully, more stable. (cherry picked from commit cbbda62258360f035894cff9dfd66c60b0cc707f) Conflicts: test/T380-atomicity.sh
2014-10-18test: check for gdb in insert testsDavid Bremner
Commits a6cee01 and c48b12f otherwise break the build for people without gdb.
2014-10-18test/insert: check that indexing errors are accepted with --keepDavid Bremner
This is overkill for the current code path, but should provide some robustness for future changes in error handling.
2014-10-18cli/insert: require succesful message indexing for success statusJani Nikula
Add --keep option to keep any remaining stuff in index or file. We could distinguish between failures to index and failures to apply tags or maildir sync, but for simplicity just have one.
2014-10-18test/insert: add known broken tests for indexing failuresDavid Bremner
These tests are written with the assumption that we want all indexing failures to be considered as failures by notmuch insert.
2014-10-05test: Port atomicity test to PythonAustin Clements
Previously, this was implemented using a horrible GDB script (because there is no such thing as a non-horrible GDB script). This GDB script often broke with newer versions of GDB for mysterious reasons. Port the test script to GDB's Python API, which makes the code much cleaner and, hopefully, more stable.
2014-10-05configure: add debug flags by default.David Bremner
This makes development (in particular the test suite) easier. Those concerned about the extra diskspace can override the default or use strip.
2014-10-05test: check for debug symbols in notmuchDavid Bremner
In the future, tests may rely on debug symbols being present in notmuch, so we plan to switch the default flags. The main purpose of this test is to help explain the perhaps mysterious failures of other tests which rely on symbols being present.
2014-09-21emacs: Fix coding system in `notmuch-show-view-raw-message'Austin Clements
This fixes the known-broken test of viewing 8bit messages added by the previous commit.
2014-09-21test: New tests for Emacs charset handlingAustin Clements
The test of viewing 8bit messages is known-broken. The rest pass, but for very fragile reasons. The next several commits will fix the known-broken test and make our charset handling robust.
2014-09-21test/emacs: globally force the html renderer to html2textDavid Bremner
Previously we did this for a single test, but some other proposed tests ( id:1398105468-14317-3-git-send-email-amdragon@mit.edu ) show similar breakage when switching renderers.
2014-09-13test: simplify T360-symbol-hiding, use nm instead of objdumpDavid Bremner
After yet another variation in objdump output caused this test to fail (on a Debian port, no less), I decided whatever putative benefit we get from looking at the object files instead of the library isn't worth the maintenence headache. This version uses nm -P. nm -P should be portable, and fixed format. It purposely doesn't use the -D argument, since that is non-POSIX and nm on GNU/Linux seems do the right thing without it. It still won't work out of the box on e.g. Mac OS/X. I think the right thing to do there is to move some more configuration information into sh.config.
2014-09-07cli: Be more helpful when .notmuch-config does not existAustin Clements
Previously, if the user ran any subcommand that required a configuration (e.g., notmuch new) but didn't have a configuration, notmuch would give the rather un-friendly and un-actionable message Error reading configuration file .notmuch-config: No such file or directory Since this condition is expected for new users, this patch adds specific handling for the file-not-found case to give a message that is friendly and actionable.
2014-08-30test: Tests for future version and unknown feature handlingAustin Clements
2014-08-30test: Tool to build DB with specific version and featuresAustin Clements
This will let us test basic version and feature handling.
2014-08-30new: Don't report version after upgradeAustin Clements
The version number has always been pretty meaningless to the user and it's about to become even more meaningless with the introduction of "features". Hopefully, the database will remain on version 3 for some time to come; however, the introduction of new features over time in version 3 will necessitate upgrades within version 3. It would be confusing if we always tell the user they've been "upgraded to version 3". If the user wants to know what's new, they should read the news.
2014-08-16Make parsing of References and In-Reply-To header less error proneMichal Sojka
According to RFC2822 References and In-Reply-To headers are supposed to contain one or more Message-IDs, however older RFC822 allowed almost any content. When both References and In-Reply-To headers ends with something else that a Message-ID (see e.g. [1]), the thread structure presented by notmuch is incorrect. The reason is that notmuch treats this case as if the email contained no "replyto" information (see _notmuch_database_link_message_to_parents). This patch changes the parse_references() function to return the last valid Message-ID encountered rather than NULL resulting from the last hunk of text not being the Message-ID. [1] https://lkml.org/lkml/headers/2014/5/19/864
2014-08-16Add test for incorrect threading of messagesMichal Sojka
This happens when there is some garbage after the last Message-ID in the References header. See for example https://lkml.org/lkml/headers/2014/5/19/864.
2014-08-06test: Include generated dependencies for test sourcesAustin Clements
Previously the build system was generating automatic header dependencies for test sources, but only smtp-dummy was in SRCS, so only its dependencies were being included. Add all of the test sources to SRCS so that the root Makefile.local includes their dependencies.
2014-08-05emacs: Expand default saved searches and add shortcut keysAustin Clements
This should help new users off to a better start with the addition of more sensible saved searches and default shortcut keys. Most existing users have probably customized this variable and won't be affected.
2014-07-16dump: make dump take Xapian write lockMark Walters
Dump currently only takes the read lock. Xapian can cope with some changes while maintaining a read snapshot but with more changes it fails. Currently notmuch just gives a xapian error. To avoid this we take the write lock when dumping. This prevents other notmuch processes from modifying the xapian database preventing this error. Discussion with Olly on irc indicates that this is currently the best solution: in xapian trunk there may be better possibilities using snapshots but they need to make it to a release and propogate out to users before we can switch approach. Finally, this breaks one use case: pipelines of the form notmuch dump | ... | notmuch restore According to Olly this is already very fragile: it will only work on small databases. One of the tests relies on this behaviour so fix that to store the dump rather than use a pipe.
2014-07-16test: Test thread linking in all possible delivery ordersAustin Clements
These tests deliver all possible (single-root) four-message threads in all possible orders and check that notmuch successfully links them into threads. These tests supersede and replace the previous and much less thorough "T260-thread-order" tests. There are two variants of the test: one delivers messages that reference only their immediate parent and the other delivers messages that reference all of their parents. The latter test is currently known-broken.
2014-07-13test: redirect gdb output to a file.David Bremner
It seems that the normal output redirection in the test suite doesn't work for gdb, but it's nice to have output in a file for debugging.
2014-07-13test: make test_emacs call post-command-hookDavid Bremner
The unread/read changes will use the post-command-hook. test_emacs does not call the post-command-hook. This adds a notmuch-test-progn which takes a list of commands as argument and executes them in turn but runs the post-command-hook after each one. The caller can batch operations (ie to stop post-command-hook from being interleaved) by wrapping the batch of operations inside a progn. We also explicitly run the post-command-hook before getting the output from a test; this makes sense as this will be a place the user would be seeing the information.
2014-07-13test: use sh.config for configurationJani Nikula
2014-06-22Merge branch 'release'David Bremner
Austin's termpos patches and Felipe's zlib.pc workaround
2014-06-18lib: Separate all phrases indexed by _notmuch_message_gen_termsAustin Clements
This adds a 100 termpos gap between all phrases indexed by _notmuch_message_gen_terms. This fixes a bug where terms from the end of one header and the beginning of another header could match together in a single phrase and a separate bug where term positions of un-prefixed terms overlapped. This fix only affects newly indexed messages. Messages that are already indexed won't benefit from this fix without re-indexing, but the fix won't make things any worse for existing messages.
2014-06-18test: Known-broken test for overlapping/adjacent termposAustin Clements
This adds two known-broken tests and one working test related to the term positions assigned to terms from different headers or MIME parts. The first test fails because we don't create a termpos gap between different headers. The second test fails because we don't adjust termpos at all when indexing multiple parts.
2014-06-18lib: Index name and address of from/to headers as a phraseAustin Clements
Previously, we indexed the name and address parts of from/to headers with two calls to _notmuch_message_gen_terms. In general, this indicates that these parts are separate phrases. However, because of an implementation quirk, the two calls to _notmuch_message_gen_terms generated adjacent term positions for the prefixed terms, which happens to be the right thing to do in this case, but the wrong thing to do for all other calls. Furthermore, _notmuch_message_gen_terms produced potentially overlapping term positions for the un-prefixed copies of the terms, which is simply wrong. This change indexes both the name and address in a single call to _notmuch_message_gen_terms, indicating that they should be part of a single phrase. This masks the problem with the un-prefixed terms (fixing the two known-broken tests) and puts us in a position to fix the unintentionally phrases generated by other calls to _notmuch_message_gen_terms.
2014-06-18test: Add search tests for combined name/address queriesAustin Clements
Two of these are currently known-broken. We index the name and address parts in two separate calls to _notmuch_message_gen_terms. Currently this has the effect of placing the term positions of the prefixed terms from the second call right after those of the first call, but screws up the term positions of the non-prefixed terms.
2014-06-18test: Fix from/to search test queriesAustin Clements
Two of the search tests for "from" and "to" queries were clearly trying to search for prefixed phrases, but forgot to shell quote the phrases. Fix this by quoting them correctly.
2014-06-13Merge branch 'release'David Bremner
Merge in a few more commits towards 0.18.1
2014-06-13lib: resurrect support for single-message mbox filesJani Nikula
This is effectively a revert of commit 6812136bf576d894591606d9e10096719054d1f9 Author: Jani Nikula <jani@nikula.org> Date: Mon Mar 31 00:21:48 2014 +0300 lib: drop support for single-message mbox files The intention was to drop support for indexing new single-message mbox files (and whether that was a good idea in the first place is arguable). However this inadvertently broke support for reading headers from previously indexed single-message mbox files, which is far worse. Distinguishing between the two cases would require more code than simply bringing back support for single-message mbox files.
2014-06-13test: use --quick when starting emacs.David Bremner
At least in emacs24, this removes the "site-lisp" directories from the load path in addition to enforcing --no-site-lisp --no-init-file. This works around a slightly mysterious bug on Debian that causes test-lib.el not to load when there is cl-lib.el(c) in some site-lisp directory. It should be harmless in general since we really don't want to load any files from addon packages to emacs.
2014-05-28build: add datacleanDavid Bremner
It turns out to be inconvenient to delete the downloaded datafiles with distclean, so I propose a new target which does that instead. The closest conventional target is 'maintainer-clean'; the difference here is that having the original source tarball is not enough to reconstruct these files.
2014-05-18Merge branch 'release'David Bremner
bugfix release being built up on release.