summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
* test: Update emacs tests for fix to counting of signature lines.Carl Worth2010-11-11
| | | | The recent bug fix invalidated some expected test results. Fix them up.
* tags_to_maildir_flags: Fix to preserve existing, unsupported flagsCarl Worth2010-11-11
| | | | | | This is to prevent notmuch from destroying any information the user has encoded as flags in the maildir filename. Tests are also added to the test suite to verify the documented behavior.
* notmuch_message_tags_to_maildir_flags: Do nothing outside of "new" and "cur"Carl Worth2010-11-11
| | | | | | | | | | | Some people use notmuch with non-maildir files, (for example, email messages in MH format, or else cool things like using sluk[*] to suck down feeds into a format that notmuch can index). To better support uses like that, don't do any renaming for files that are not in a directory named either "new" or "cur". [*] https://github.com/krl/sluk/
* test: Move corpus emails into maildir directory structureCarl Worth2010-11-11
| | | | | Now that we have maildir synchronization turned on by default, it's advantageous to make all of the tests exercise it as much as possible.
* test: Fix emacs FCC test to account for new maildir synchronizationCarl Worth2010-11-11
| | | | | | The FCC code saves a message in maildir format, and sets the S flag by default, so now, automatically, FCC messages will not show up as "unread", (which seems natural enough).
* Enable maildir synchronization by default.Carl Worth2010-11-11
| | | | | This is a useful feature that most people should want, so enable it by default, (still allowing customization to disable it of course).
* test: Drop test for propagating flag changes from one file to anotherCarl Worth2010-11-11
| | | | | | | | | | | There's nothing in the current API documentation that would suggest the behavior being tested here. Attempt to implement this could have some nasty side effects, (such as notmuch_message_maildir_flags_to_tags implicitly calling notmuch_message_tags_to_maildir_flags and maybe even opening up some bad looping possibilities). Much better to stick with what we have documented, which we believe will actually be useful, (and easy enough to comprehend).
* test: Add a new test that removal of a maildir flag also changes tagsCarl Worth2010-11-11
| | | | This test exposes an existing bug, so is currently failing.
* test: Rework recently-added additional maildir-sync testsCarl Worth2010-11-11
| | | | | | | | | | | | | | | These needed to be changed to be brought up to the current state of the maildir-sync tests. This includes style changes, but also the elimination of any assumption about pre-existing message filenames, (such as msg-003) which actually don't exist anymore. Also, the known broken tests are changed to emit FAIL rather than BROKEN simply to make them easier to fix, (so that they print the current problems rather than hiding them). Finally, an additional test is added to ensure that when a duplicate file is added without flags, it doesn't invalidate flags from other duplicates, (instead the flags are effectively merged).
* test: More maildir synchronization testsMichal Sojka2010-11-11
| | | | | | | | | Add maildir synchronization tests for multiple messages with the same message-id. As this is not yet implemented in notmuch, some of these teste are marked as BROKEN. I use $(< ) operator to avoid fiddling with stripped trailing newlines from test results which happens when output+=$(command) is used.
* test: Rework testing of maildir-synchronization feature.Carl Worth2010-11-11
| | | | | | | | | | | | | | | | | | | | | | | | | | This change reworks these tests in several ways: 1. Bring tests into "new" test style preferring test_expect_equal over test_expect_success in almost all cases. 2. Don't emit test results for intermediate items not actually being tested, (things like "no new messages", "search for message", etc.). Those things are already covered by existing tests such as "basic" or "search" and only serve to obscure what's actually being tested. 3. Change sense of the test showing failure to rename a file from "new" to "cur" when "cur" doesn't exist. In this case, notmuch should detect that this is not a maildir and should not attempt to do any renaming of the file. 4. Extend dump/restore test to also exercise addition of tag, not just removal. Both items #3 and #4 above show shortcomings in the current implementation. These are currently resulting in test results of FAIL and indicate bugs that need to be fixed.
* Tests for maildir synchronizationMichal Sojka2010-11-10
| | | | Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
* test: Don't strip portions of test name after '-' for temporary files.Carl Worth2010-11-10
| | | | | | | We have test names like maildir-sync now, so it's cleaner if the temporary files created are named things like maildir-sync-10.out rather than maildir-10.out. Presumably the extra stripping here came from naming conventions in git's test suite.
* test: Add test for viewing raw message within emacs.Carl Worth2010-11-06
| | | | | This provides further coverage for the recently added (and recently modified) use of "notmuch show --format=raw" within emacs.
* Rename "notmuch cat" to "notmuch show --format=raw"Carl Worth2010-11-06
| | | | | | | | | This is part of an effort to avoid proliferation of excessive top-level notmuch commands. Also, "raw" better captures the functionality here, (as opposed to "cat" which is a fairly oblique reference to a bad Unix abbreviation whose metaphor doesn't work here since "notmuch cat" operates only on a single message and hence cannot "con'cat'enate" anything).
* test: Add test for saving an attachment from emacsCarl Worth2010-11-06
| | | | | This tests the use of "notmuch cat" recently added to the emacs interface.
* Add 'cat' subcommandMichal Sojka2010-11-05
| | | | | | | | | | | | This command outputs a raw message matched by search term to the standard output. It allows MUAs to access the messages for piping, attachment manipulation, etc. by running notmuch cat rather then directly access the file. This will simplify the MUAs when they need to operate on a remote database. Edited-by: Carl Worth <cworth@cworth.org>: Remove trailing whitespace, add missing "test_done" to new test script to avoid "Unexpected exit" error.
* Makefile: Support "make check" as alias for "make test"Carl Worth2010-11-05
| | | | | I'm told that some people have been trained by autotools to expect this target name.
* test: Don't mess with user's HOME directoryCarl Worth2010-11-05
| | | | | | | | | | This was too rude of a thing to do and could easily introduce problems, (as reported by Rob Browning whose environment required some HOME-specific things for shell startup). Instead, implement more focused changes to ensure that particular file in $HOME don't cause problems. Specifically, we fix known problems with ~/.signature and ~/.mailrc here.
* test: Update mail corpus with original mails (with attachments).Carl Worth2010-11-05
| | | | | | | | The original mails used to pupulate the mail corpus had had their attachments (obnoxiously) scrubbed by the pipermail mail archiver. Since we actually want to test the handling of attachments, this is less than useful. Restore these files from my own collection, (with some Received and similar headers pruned).
* test: Clear the "BROKEN" flag on an existing emacs testCarl Worth2010-11-05
| | | | | | | | | | | I still don't know everything about how I want search order to be customizable, but I do like the current defaults, (namely, performing a new search gives results newest first, but performing a saved search like "tag:inbox" gives results as oldest first). Until we come up with a better plan for people to select what *they* want, (rather than just getting what I want), let's codify the current results in the test suite.
* test: Generate a little run_emacs script to help debug any failures.Carl Worth2010-11-05
| | | | | | | | After any emacs test failure, the tmp.emacs directory will have this run_emacs script in it which the user can use to run emacs within the test suite environment, (pointing at the test suite's notmuch database, using the local notmuch command-line program, and the local notmuch emacs lisp code).
* test: Search for non-existent message should return nothingMichal Sojka2010-11-04
| | | | | | | | | | | | | My scripts expect that empty search result is actually empty. Since commit 6dcb7592, even empty search prints a newline character and this breaks my scripts. This patch adds a test for this bug. In the test I cannot use test_expect_equal function as $() operator suppresses the final newline and this kind of difference is not detected. test/search | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
* test: Test emacs notmuch-hello with no saved searches to display.Carl Worth2010-10-29
| | | | Haippily, this works just fine, but we might as well test that.
* test: Test emacs notmuch-hello when displaying a saved search with 0 results.Carl Worth2010-10-29
| | | | This test verifies that the bug fix in the previous commit is working.
* test: Emit a friendly error message if run with bash < 4.0.Carl Worth2010-10-28
| | | | | | | | | | The bash code in the test suite is using associative arrays which were only added to bash as of release 4.0. If the test suite is run with an older bash, we now immediately error out and explain the situation, (instead of emitting confusing error messages and failing dozens of tests, which is what happened before this change).
* test: Avoid using unreliable, hard-coded thread ID values in test suite.Carl Worth2010-10-28
| | | | | | | | | | Some recently-added tests used hard-coded thread ID values in search specifications. This is unreliable since the thread IDs depend on the order in which "notmuch new" encounters new files, (which in turn can depend on inode ordering within the filesystem). Fix these by using the new "notmuch search --output=threads" to find the correct thread IDs given a hard-coded (but reliable) message ID.
* test: Add test for reply functionality within emacs.Carl Worth2010-10-27
| | | | | | The reply is primarily taken care of by "notmuch reply" which is already thoroughly tested. But a recent bug is inserting a duplicate From header in the emacs-based reply. So exercise that bug here.
* test: Update tests with removal of bcc from replyJameson Rollins2010-10-27
| | | | | | | | Update the tests so that they no longer expect the Bcc header in the output of "notmuch reply" now that it has been removed. Edited-by Carl Worth: Simply applying the change to our newly modularized test suite.
* test: Add test for fully-roundtripped FCCCarl Worth2010-10-27
| | | | | | We test that the message we sent via (fake) SMTP is included in the mail index after a "notmuch new". This verifies that the FCC setting indeed successfully saved the sent message within the notmuch mail store.
* test: Use an explicit date in the message sent via (fake) SMTPCarl Worth2010-10-27
| | | | | | Simply setting an explicit date is cleaner than letting the current, (arbitrary), date get generated for the email message and then constantly filtering that date out of search results.
* emacs: Explicitly set the From address when composing a new message.Carl Worth2010-10-27
| | | | | Previously, underlying emacs code was setting this header. Now, we do the right thing and query the notmuch configuration for the default value here.
* emacs: Enable FCC (to a directory named "sent") by default.Carl Worth2010-10-27
| | | | | | Now that the FCC code is fixed to use the notmuch database path, we can actually enable this by default, which should be highly useful for all new users of notmuch.
* TODO: Note idea for a new "notmuch compose"Carl Worth2010-10-27
| | | | | | Which would also allow the recently added test of sending an email message with the emacs interface to be a little more honest about the From address.
* test: Add test that emacs interface actually sends mail.Carl Worth2010-10-27
| | | | | | | | | Rather than *reall* sending mail here, we instead have a new test program, smtp-dummy which implements (a small piece of) the server-side SMTP protocol and saves a mail message to the filename provided. This gives us reasonable test coverage of a large chunk of the notmuch+emacs code base (down to talking to an SMTP server with the final mail contents).
* test: Set alternate HOME during tests.Carl Worth2010-10-27
| | | | | | We set the HOME environment variable to the test directory to avoid the tests relying on any configuration files from the test author's own home directory, (such as ${HOME}/.emacs or similar).
* test: Fix false failure from the "available tests" test.Carl Worth2010-10-22
| | | | | We recently added a new sub-directory below test, so we have to blacklist it explicitly in this test.
* emacs: Fix quoting of Message-Id to fix test case of Id containing ".."Carl Worth2010-10-22
| | | | | | If Xapian sees unquoted ".." as in id:123..456 then it thinks that's a range specification. We avoid this problem by instead passing id:"123..456" to Xapian.
* test: Add test demonstrating failure in emacs interface when Message-Id has ..Carl Worth2010-10-22
| | | | | Thanks to Jameson Rollins for pointing out this bug (id:87y6g7zr6q.fsf@servo.finestructure.net).
* test: Add tests for adding/removing tags within emacs interfaceCarl Worth2010-10-22
| | | | Exercising both the notmuch-search and notmuch-show views.
* test: Add simple tests for navigating notmuch-hello and notmuch-search viewsCarl Worth2010-10-22
| | | | | | | | | | | | | | | | | We simulate the act of selecting the "inbox" saved search from notmuch-hello and the act of selecting a desired thread from the notmuch-search results. The test for the navigation of notmuch-hello is currently marked as BROKEN since its output is in the opposite order compared to the '(notmuch-search "tag:inbox")' test. This question of ordering is a currently open issue on the notmuch mailing list, so we'll let the test suite reflect that for now. Finally, this commit also abstracts some common emacs lisp code, (waiting for the current buffer's process to complete), into a new notmuch-test-wait function that is made available to anything calling test_emacs.
* test: Add a new test_expect_equal_failureCarl Worth2010-10-22
| | | | | Which allows us to have a known-broken test that would otherwise use test_expect_equal.
* test: Add tests for emacs notmuch-search and notmuch-show functions.Carl Worth2010-10-22
| | | | | Moving the expected output into individual files (rather than inline) to keep the test script much easier to read.
* emacs: Remove the joke from the first line of the notmuch-hello view.Carl Worth2010-10-22
| | | | Overuse just makes the joke unfunny.
* test: Add the most rudimentary testing of the emacs interface.Carl Worth2010-10-22
| | | | | | So far, this is doing nothing more than adding a corpus of email and ensuring that the `notmuch-hello' function produces the desired output.
* test: Add a new test_emacs function to test-lib.shCarl Worth2010-10-22
| | | | | | | | This should be quite handy for doing automated testing of the emacs-based functionality in notmuch. This function invokes emacs with the necessary command-line arguments, (to run in batch mode with no local initialization, to load the notmuch code from the source directory, and to ensure an 80-column width).
* test: Fix add_email_corpus function to be quiet.Carl Worth2010-10-22
| | | | This simply avoids some unneeded noise in the "make test" output.
* test/README: Document add_email_corpus (and add_message/generate_message)Carl Worth2010-09-20
| | | | | | While adding the documentation here for add_email_corpus I noticed that the other email-adding functions in test-lib.sh were not yet documented here, so add all of that documentation.
* test: Fix the search and dump-restore tests to operator on non-empty mail store.Carl Worth2010-09-20
| | | | | We do this with a new add_email_corpus function that establishes a mail store with 50 messages from the notmuch mailing list.
* test: Add a corpus of email messages to be used in testing.Carl Worth2010-09-20
| | | | | This is simply 50 messages from the early history of the notmuch mailing list, (fetched from the public archives).