aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
Commit message (Collapse)AuthorAge
* notmuch-dump: deprecate use of output file argument.Gravatar David Bremner2011-10-16
| | | | | | | | | We print an intentionally non-specific message on stderr, since it isn't clear if there will be some global output file argument to replace. We update the test suite atomically, since it relies on having the same text in two files.
* notmuch-dump: treat any remaining arguments after the filename as search termsGravatar David Bremner2011-10-16
| | | | | | | | | The main motivation here is allow the fast dumping of tag data for messages having certain tags. In practice it seems too slow to pipe dump to grep. All dump-restore tests should be working now, so we update test/dump-restore accordingly
* test: add tests for command line arguments to notmuch-dumpGravatar David Bremner2011-10-16
| | | | | The plan is to add the possibility of search terms after the file name, and the use of -- to stop looking for an output file name.
* test: update dump-restore to use redirection instead of filename argsGravatar David Bremner2011-10-12
| | | | | | The idea here is that we want to deprecate the use of arguments to dump and restore to specify paths, since in particular we want to use the non-option arguments to dump to form a query.
* test: add two emacs tests for show mode refreshGravatar Jameson Graef Rollins2011-10-09
| | | | | | | | | | | | | The first test tests that the notmuch-show-refresh-view function produces the exact same output for an unmodified show buffer. This test should pass since the relevant functionality has already been applied. The second test tests show refresh for a show buffer that has been modified by navigation and message visibility toggling. Ideally refresh-view should preserve this state of the notmuch-show buffer. Unfortunately it currently does not, so this test is know to be broken and is marked as such.
* test: test for absence of "Non-text part: application/pgp-*" lines in replyGravatar Jameson Graef Rollins2011-10-06
| | | | | | In reply, the quoted text does not need to mention that the original message had "application/pgp-signed" or "application/pgp-encrypted" parts.
* test/multipart: test for absence of "Non-text part:" lines in reply for ↵Gravatar Jameson Graef Rollins2011-10-06
| | | | | | | | | multipart/* and message/rfc822 parts There's no reason to output "Non-text part:" lines for parts that are not leaf nodes, eg. multipart/* and message/rfc822. We fix the text here to test for their absence. The next patch will fix reply accordingly.
* test/atomicity: redirect output from "which"Gravatar David Bremner2011-09-25
| | | | | Without redirection, this produced some slightly confusing output in case gdb was present.
* test: make atomicity setup conditional on gdb being present.Gravatar David Bremner2011-09-24
| | | | | | | The setup is useless if gdb is not present, so it doesn't hurt to skip it. The diff here is huge, but the commit is really just moving most of the script inside the initial if, and adding an else block to print a warning.
* new: Wrap adding and removing messages in atomic sections.Gravatar Austin Clements2011-09-24
| | | | | | This addresses atomicity of tag synchronization, the last atomicity problems in notmuch new. Each message add or remove is wrapped in its own atomic section, so interrupting notmuch new doesn't lose progress.
* test: use test_expect_equal_file in atomicityGravatar David Bremner2011-09-13
| | | | | The documentation claims this is more robust, and it seems to work fine to switch to the _file variant.
* test: Convert atomicity test to use test_subtest_known_brokenGravatar David Bremner2011-09-13
| | | | This is required because test_expect_equal_failure went away.
* test: Test atomicity of notmuch new.Gravatar Austin Clements2011-09-12
| | | | | | | This tests notmuch new's ability to recover from arbitrary stopping failures. It interrupts notmuch new after every database commit and, on every resulting database snapshot, re-runs notmuch new to completion and checks that the final database state is invariant.
* test: Report test failures from test_expect_*Gravatar Austin Clements2011-09-12
| | | | | | This makes test_expect_* return non-zero if the test fails, so the caller can make decisions based on this, such as setting test prerequisites.
* test: Fix message when skipping test_expect_equal* testsGravatar Austin Clements2011-09-12
| | | | | | For these types of tests, the test name is previously recorded in a variable, not passed to the test function, so pass this variable to test_skip.
* test: reset test_subtest_known_broken_ after each success/failure.Gravatar David Bremner2011-09-12
| | | | | | | | | | | This means that test_subtest_known_broken needs to be called before every known broken subtest, which is no different than what is documented for the test_begin_subtest case. The assumption is that every test ends up calling either skipping, calling test_ok_ or test_failure_ and and the latter in turn delegate to the known_broken versions in the case where test_subtest_known_broken_ is set.
* test: mark multipart rfc822 part test as brokenGravatar David Bremner2011-09-10
| | | | | | Using the new test_subtest_known_broken support thanks to Dmitry Kurochkin. This makes the output less scary until we can fix the underlying problems.
* test: remove documentation for test_expect_equal_failure.Gravatar David Bremner2011-09-10
| | | | The actual function was deleted in commit 4cc67276
* test: add emacs test for hiding a message following an HTML partGravatar Dmitry Kurochkin2011-09-10
| | | | | | | | | | | | | | | | | | | | | | | | | Human-friendly scenario: * open a thread where a message which ends with an HTML part is followed by another message * make the first message visible * goto the beginning of the second message (first line, first colon) * hit "RET" Result: nothing happens except for "No URL at point" message Expected result: the second message is shown/hidden The root cause is that the HTML part has `keymap' text property set. In particular, "RET" is bound to visit a URL at point. The problem is that `keymap' property affects the next character following the region it is set to (see elisp manual [1]). Hence, the first character of the next message has a keymap inherited from the HTML part. [1] http://www.gnu.org/software/emacs/elisp/html_node/Special-Properties.html
* test: improve known broken tests supportGravatar Dmitry Kurochkin2011-09-10
| | | | | | | | | | | | | | | | | There is existing support for broken tests. But it is not convenient to use. The primary issue is that we have to maintain a set of test_expect_*_failure functions which are equivalent to the normal test_expect_* counterparts except for what functions are called for result reporting. The patch adds test_subtest_known_broken function which marks a subset as broken, making the normal test_expect_* functions behave as test_expect_*_failure. All test_expect_*_failure functions are removed. Test_known_broken_failure_ is changed to format details the same way as test_failure_ does. Another benefit of this change is that the diff when a broken test is fixed would be small and nice. Documentation is updated accordingly.
* test: update documentation for test_emacs in test/READMEGravatar Dmitry Kurochkin2011-09-10
| | | | | | Update test_emacs documentation in test/README according to the latest changes in emacs tests. Move the note regarding setting variables from test/emacs to test/README.
* test: overhaul multipart test to test for improved message/rfc822 handlingGravatar Jameson Graef Rollins2011-09-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main goal of this overhaul is to define how message/rfc822 parts should be handled. message/rfc822 parts should be output in a similar fashion to the outer message, including some subset of the rfc822 headers. The following decisions about formatting of message/rfc822 parts were made: The format and content of message/rfc822 parts shall be as similar as possible to that of full messages. In particular, for formatted outputs, the "content" of rfc822 part output should include "headers" and "body" fields). The "body" field shall include the body of the message. The "headers" field shall include the following headers, since these are the ones available from the GMimeMessage: "From" "To" "Cc" "Subject" "Date" However, for the case of --format=raw the raw rfc822 should be output, including all headers. A subset of relevant headers shall be output in reply. The test embedded rfc822 message is also modified to be itself multipart, so we can more fully test how all sub parts of the message part are output. Note added by Committer: Currently, expect one test (--format=raw --part=3, rfc822 part) to fail.
* test: Fix date in test message in multipart test.Gravatar Jameson Graef Rollins2011-09-05
| | | | | | | | | | | | | | | | The test message date, "Tue, 05 Jan 2001 15:43:57 -0000", is not actually a real date. 05 Jan 2001 was in fact a Friday, not a Tuesday. Date parsers (such as "date" in coreutils) will return "Fri" as the day for this string, even if "Tue" is specified. Also, the time zone "-0000" is actually always returned as "+0000", so we change that here was well. This will be relevant for later patches when we begin parsing rfc822 part headers, where gmime returns a parsed date string. If we do want to test date parsing, we should do that in a separate test.
* test: some small fixes to multipart testGravatar Jameson Graef Rollins2011-09-05
| | | | | | | | There were two "--format=text --part=0" tests. One of them was supposed to be a test for "--format=text --part=1". There were also two errant "test_expect_equal_file OUTPUT EXPECTED" lines, that are removed here.
* emacs: Fix to unconditionally display subject changes in collapsed thread viewGravatar Carl Worth2011-07-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The feature to show subject changes in the collapsed thread view was originally added (8ab433607) with an option (notmuch-show-always-show-subject) to display the subject for all messages, even when there was no change. The subsequent commit (4f04d273) changed the sense of the test (or to and) and the name of the controlling variable (notmuch-show-elide-same-subject). But this commit is broken in a few ways: 1. The original definition of notmuch-show-always-show-subject was left around But the variable isn't actually used in the code at all, so it just adds clutter and confusion to the customization interface. 2. The name and description of the controlling variable doesn't match the implementation The name suggests that setting the variable to t will cause repeated subjects to be elided, (suggesting that when it is nil all subjects will be shown). However, when the variable is nil, no subjects are shown. So a correct name for the variable in this sense would be notmuch-show-subject-changes. Showing subject changes is a useful feature, and should be on by default. (We don't want to bury generally useful features behind customizations that users have to find). Rather than fixing the name of the variable and changing its default value, here we remove the condition entirely, such that the feature is enabled unconditionally. So both the currently-used variable and the stale definition of the formerly-used are removed. Also, the one relevant test-suite result is updated, (showing the intial subject of a collapsed thread, and no subject display for later messages that do not change the subject).
* test: document test_expect_equal_fileGravatar Jameson Graef Rollins2011-06-29
| | | | | This test was not properly documented when it was originally added (my bad).
* test: Nix increment_mtime.Gravatar Austin Clements2011-06-29
| | | | | With the fix for the mtime race, this workaround is no longer necessary.
* test: revert non-intentional changes introduced in eb4cf465Gravatar Pieter Praet2011-06-29
| | | | | | | | | | | | | | | | | | | | | | | eb4cf465 introduces changes which weren't part of the submitted patch (id:"87liwlip2j.fsf@gmail.com"), presumably made during resolving merge conflicts. The first one causes the title of a test to be printed a second time, in place of the correct title: PASS Message with .. in Message-Id: PASS Message with .. in Message-Id: instead of: PASS Message with .. in Message-Id: PASS Sending a message via (fake) SMTP The second one is simply the insertion of a line break, so no harm there. This commit reverts both changes, as they were clearly accidental. Signed-off-by: Pieter Praet <pieter@praet.org>
* test: Use increment_mtime rather than sleepGravatar Carl Worth2011-06-29
| | | | | | | | | | | The sleep was to force the directory's mtime to advance between the previous notmuch new and the subsequent rm;notmuch new. The current convention is to use the existing increment_mtime function for this purpose, (which avoids the test suite being slowed down by calls to sleep). Thanks to Austin Clements for noticing this undesired sleep.
* test:Folder tags shouldn't match after removal of file in given folderGravatar Mark Anderson2011-06-29
| | | | | | | | | | | Test for bug. Current stemming support for notmuch adds extra terms to the DB which aren't removed when the file renames are detected. When folder tags are added to a message, Xapian terms for both XFOLDER and ZXFOLDER are generated. When one of the filenames are renamed/removed, only the XFOLDER tags are removed, leaving it possible for a match on a folder: tag that was previously but is no longer a match in the maildir.
* test: fix tests after notmuch show output changes related to filenamesGravatar Dmitry Kurochkin2011-06-28
| | | | | | Adding the filename propery alongside ID and Content-type. This makes the test suite pass again after the recent change.
* test: use emacsclient(1) for Emacs testsGravatar Dmitry Kurochkin2011-06-28
| | | | | | | | | | | | | | | | | Before the change, every Emacs test ran in a separate Emacs instance. Starting Emacs many times wastes considerable time and it gets worse as the test suite grows. The patch solves this by using a single Emacs server and emacsclient(1) to run multiple tests. Emacs server is started on the first test_emacs call and stopped when test_done is called. We take care not to leave orphan Emacs processes behind when test is terminated by whatever reason: Emacs server runs a watchdog that periodically checks that the test is still running. Some tests need to provide user input. Before the change, this was done using echo(1) to Emacs stdin. This no longer works and instead `standard-input' variable is set accordingly to make `read' return the appropriate string.
* test: Increment mtime when delivering a message with emacs_deliver_messageGravatar Carl Worth2011-06-28
| | | | | | Without this, mail messages delivered by emacs_deliver_message might not be seen by the next invocation of "notmuch new", (which can lead to test-suite failures if emacs_deliver_message is fast enough).
* test:Improve test behaviors when --root is usedGravatar Mark Anderson2011-06-28
| | | | | | | | | | | Change add_email_corpus, emacs_deliver_message and tests to use $TEST_DIRECTORY instead of '..'. This improves the behavior of the usage of --root=<dir>, as the assumption of what '..' means will usually be incorrect. Document -root option in README and update valgrind to work with -root.
* test: generate run_emacs script once on test startupGravatar Dmitry Kurochkin2011-06-28
| | | | | | | Instead of generating auxiliary run_emacs script every time test_emacs is run, do it once in the beginning of the test. Also, use absolute paths in the script to make it more robust.
* test: set variables using `let' instead of `setq' in Emacs testsGravatar Dmitry Kurochkin2011-06-28
| | | | | | | | | Using `setq' for setting variables in Emacs tests affect other tests that may run in the same Emacs environment. Currently it works because each test is run in a separate Emacs instance. But in the future multiple tests will run in a single Emacs instance. The patch changes all variables to use `let', so the scope of the change is limited to a single test.
* test: use emacs_deliver_message in Emacs SMTP send testGravatar Dmitry Kurochkin2011-06-28
| | | | | Minor changes to expected results of other Emacs tests were needed because the message Date header changed.
* test: remove some sed(1) calls in Emacs testsGravatar Dmitry Kurochkin2011-06-28
| | | | | | | | Few Emacs tests used sed(1) to remove unexpected output in the beginning to avoid getting confused by messages such as "Parsing /home/cworth/.mailrc... done". This is no longer needed since tests are run in a temporary home directory instead of the user's one. So remove these sed(1) calls.
* test: save buffer content to file instead of printing it in Emacs testsGravatar Dmitry Kurochkin2011-06-28
| | | | | | | | | | | | | | | | | | | | | | Before the change, the common Emacs test scheme was to print buffer content to stdout and redirect it to a file or capture it in a shell variable. This does not work if we switch to using emacsclient(1) for running the tests, because you can not print to the stdout in this case. (Actually, you can print to stdout from Emacs server, but you can not capture the output on emacsclient(1)). The patch introduces new Emacs test auxiliary functions: `test-output' and `test-visible-output'. These functions are used to save buffer content to a file directly from Emacs. For most tests the changes are trivial, because Emacs stdout output was redirected to a file anyway. But some tests captured the output in a shell variable and compare it with the expected output using test_expect_equal. These tests are changed to use files and test_expect_equal_file instead. Note: even if we do not switch Emacs tests to emacsclient(1), the patch makes tests cleaner and is an improvement.
* test: wrap and indent test_emacs callsGravatar Dmitry Kurochkin2011-06-28
| | | | | | | Most test_emacs calls have long arguments that consist of many expressions. Putting them on a single line makes it hard to read and produces poor diff when they are changed. The patch puts every expression in test_emacs calls on a separate line.
* test: cleanup test_emacsGravatar Dmitry Kurochkin2011-06-28
| | | | | Move auxiliary function definition and configuration from command line to test-lib.el.
* test: do not set `message-signature' in test_emacsGravatar Dmitry Kurochkin2011-06-28
| | | | | It is no longer needed since tests are run in a temporary home directory instead of the user's one.
* test: fix argument order of test_expect_equal_file in few testsGravatar Dmitry Kurochkin2011-06-28
| | | | | | Few Emacs tests had test_expect_equal_file arguments in the wrong order: the first argument should be the test output and the second one should be the expected.
* test:Expect multiple filenames for message with multiple filesGravatar Mark Anderson2011-06-28
| | | | | | | | | | | Update the test mail corpus to have two files with the same content to expose the bug where a single message with multiple filenames only reports a single filename. Update expected results for search --output=files to match new behavior for multiple files corresponding to a single message Signed-off-by: Mark Anderson <ma.skies@gmail.com>
* test: remove useless test_emacs call from an emacs FCC testGravatar Dmitry Kurochkin2011-06-23
| | | | | This was inadvertently left over when debugging an early version of this commit. -Carl Worth <cworth@cworth.org>
* fix sum moar typos [test-case data]Gravatar Pieter Praet2011-06-23
| | | | | | | | | Various typo fixes in some test-case data. Signed-off-by: Pieter Praet <pieter@praet.org> Edited-by: Carl Worth <cworth@cworth.org> Restricted to just test-case data.
* fix sum moar typos [user-visible documentation in code]Gravatar Pieter Praet2011-06-23
| | | | | | | | | | | | Various typo fixes in documentation within the code that can be made available to the user, (emacs function help strings, "notmuch help" output, notmuch man page, etc.). Signed-off-by: Pieter Praet <pieter@praet.org> Edited-by: Carl Worth <cworth@cworth.org> Restricted to just documentation and fixed fix of "comman" to "common" rather than "command".
* fix sum moar typos [comments in source code]Gravatar Pieter Praet2011-06-23
| | | | | | | | | | Various typo fixes in comments within the source code. Signed-off-by: Pieter Praet <pieter@praet.org> Edited-by: Carl Worth <cworth@cworth.org> Restricted to just source-code comments, (and fixed fix of "descriptios" to "descriptors" rather than "descriptions").
* fix sum moar typos [build scripts, Makefiles]Gravatar Pieter Praet2011-06-23
| | | | | | | | Various typo fixes in comments within the Makefile and other build scripts. Signed-off-by: Pieter Praet <pieter@praet.org> Edited-by: Carl Worth <cworth@cworth.org> Restricted to just build files.
* fix sum moar typos [text files]Gravatar Pieter Praet2011-06-23
| | | | | | | | | Various typo fixes in auxiliary text files included with the source, (README, TODO, etc.). Signed-off-by: Pieter Praet <pieter@praet.org> Edited-by: Carl Worth <cworth@cworth.org> Restricted to just text files.