aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
Commit message (Collapse)AuthorAge
* 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.
* test: Test emacs message composing with various values for notmuch-fcc-dirsGravatar Carl Worth2011-06-23
| | | | | | | We exercise each of the documented values (nil, a string, and a list). For the list, we test matching a specific entry, matching a catch-all regular expression, and no match at all (in which case there is no FCC set).
* tests: add a test for symbol hiding side effectsGravatar David Bremner2011-06-23
| | | | | | | | | | | The worry here is that a binary linking with libnotmuch might lose access to Xapian::Error symbols because libnotmuch hides them. We are careful here to create ./fakedb/.notmuch in order to trigger a Xapian exception, and not just a missing file check. Thanks to jrollins and amddragon for suggestions. (cherry picked from commit 66f37f5f6864a988f94ddb893e3a176af57f6c8e)
* smtp-dummy: Prefer return rather than exit() in main.Gravatar Carl Worth2011-06-22
| | | | | | | | | The main() function should be written as just another function with a return value. This allows for more reliable code reuse. Imagine that main() grows too large and needs to be factored into multiple functions. At that point, exit() is probably the wrong thing, yet can also be hard to notice as it's in less-frequently-tested exceptional cases.
* Fix compilation warnings in test/smtp-dummy.c.Gravatar Dmitry Kurochkin2011-06-22
| | | | | * Remove unused variables in main(): buf, bytes and greeting. * Replace return with no value in main() with exit(3).
* tests: Add optional use of timeout utility, if present.Gravatar David Bremner2011-06-22
| | | | | | | | | | | Each top level test (basic, corpus, etc...) is run with a fixed timeout of 2 minutes. The goal here is to treat a hung test as a failure. The emacs test for sending mail is known to be problematic on the Debian autobuilders. This is both a bandaid fix for that, and a sensible long term feature. (cherry picked from commit 5f99c80e02736c90495558d9b88008a768876b29)
* test emacs: Add tests for hiding messages in notmuch-show viewGravatar Dmitry Kurochkin2011-06-15
| | | | | This test is expected to fail as it exposes a current bug, (which we hope to fix soon).
* test: Fix from-guessing to actually span Received headers over multiple linesGravatar Carl Worth2011-06-10
| | | | | | | | | | The intent was always to make these Received headers span multiple lines. But the escapes were causing the shell to ignore the newlines, so that the result instead was long Received headers on a single line each. Fixing the intent here doesn't actually change the test-suite results at all.
* test: Extend from-guessing test with a test with multiple Received headersGravatar Carl Worth2011-06-10
| | | | | | | This is much more realistic, as most messages in the wild will have multiple Received headers. Also, this demonstrates a current bug in the Received header parsing, (multiple Received headers are not properly concatenated depending on the order in which headers are parsed in a message).
* test: Add test that emacs detects and hides top-post quotes of original messagesGravatar Carl Worth2011-06-10
| | | | | | | This tests the recently-added detection/hiding of top-posted quotations and in the testing, it takes advantage of the less-recently-added visible-buffer-string function for emitting only the visible text from a buffer.
* test: modify multipart test to use test_expect_equal_fileGravatar Jameson Graef Rollins2011-06-03
| | | | | | Again, this is a much cleaner and more thorough test, and in fact exposes a bug in the format=text output, that will be fixed the next commit. Because of this, some of the multipart tests currently fail.
* test: update emacs test to use test_expect_equal_fileGravatar Jameson Graef Rollins2011-06-03
| | | | | | | | | | This is a much cleaner way to do the emacs tests, since we're actually comparing output against existing files with expected output. We also won't miss any trailing newlines this way. And speaking of which, one of the expected output files was actually missing a trailing blank line that was actually in one of the original messages, so this was fixed.
* test: add "notmuch-show for message with invalid From" testGravatar Dmitry Kurochkin2011-06-03
|
* Fix misspelling in search output sanitization test.Gravatar Austin Clements2011-06-03
| | | | | | A simple spelling fix in the text description. Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
* test: cleanup search-output test names (no functional change)Gravatar Jameson Graef Rollins2011-06-01
| | | | Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
* test: add test for sanitized notmuch-search outputGravatar Florian Friesdorf2011-06-01
| | | | | | | | | | | This feature was recently added, so it of course needs a test now. Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net> Edited-by: Carl Worth <cworth@cworth.org> Fixed test to use notmuch_search_sanitize in order to be robust against unpredictable thread ID numbers, (due to unpredictable order in which the filesystem presents files).
* test: Create and set temporary home directoryGravatar Florian Friesdorf2011-06-01
| | | | | | | | | | | | | | In the master branch in test/emacs two tests access the build users home directory, so does emacs_deliver_message in the crypto branch. The tests should not touch the build user's home directory. The patch creates a directory in the temporary test directory and sets home accordingly. In case of a non-existent home directory, the tests are failing without this patch. Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
* test: remove json test for search null result, since it's being more ↵Gravatar Jameson Graef Rollins2011-06-01
| | | | | | | properly tested in search-output The test in json was inferior to the one in search-output, since it wasn't properly testing for the presence of a trailing newline.
* test: move utf-8 subject search test from json to search test scriptGravatar Jameson Graef Rollins2011-06-01
| | | | | | This test doesn't have anything to do with json, and has everything to do with testing search capability, so I'm not sure why it was in the wrong place.
* test: Move a test from search to search-output, and add a similar json testGravatar Jameson Graef Rollins2011-06-01
| | | | | | | | | The "Search for non-existent message prints nothing" test fits better with the existing tests in search-output, so move it there. Also add a similar test for the --format=json case. These tests also use the new test_expect_equal_file function, (to ensure that the presence of a trailing newline is correctly tested).
* test: modify search-output test to use the new test_expect_equal_file functionGravatar Jameson Graef Rollins2011-06-01
| | | | | | | These test now properly test for the presence of a newline at the end of all output. Right now some of these test will fail because the search output is currently broken to *not* produce proper newlines in some cases.
* test: Add test showing notmuch corrupts a part with a CRLF pair in itGravatar Carl Worth2011-05-31
| | | | | | | | | | | | Since commit 2f8871df6ea3c0b44f85a0fc1b4f58a6b70b0a0e notmuch has been using a function (show_part_content) originally written only for text parts to save all MIME parts. The problem with this is that this function converts CRLF pairs to LF only and optionally converts to UTF-8 encoding. These two conversions have the potential to corrupt binary data when passed through the function. This test demonstrates that corruption, and so fails currently, until we fix the bug.
* test: Fix a misspelling in one of our test cases.Gravatar Carl Worth2011-05-31
| | | | | | | Not that it affects the correctness of the test, but it's nice to use proper spelling. This kind of change could invalidate a signature on the test message, but I think that would have happened previously when the HTML part was added in the first place.
* test: add test for saving attachments using notmuch-show-save-partGravatar Dmitry Kurochkin2011-05-31
| | | | | | | | Use .gz filenames for saved attachments in the tests to check that Emacs does not re-compress the file. Use test_expect_equal_file instead of test_expect_equal to avoid binary output on the console.
* test: copy files in test_expect_equal_file instead of moving themGravatar Dmitry Kurochkin2011-05-31
| | | | | | | | | | | Before the change, test_expect_equal_file moved files it compared in case of failure. The patch changes it to copy the files instead. This allows testing non-temporary files which are stored in git. Note: the change should not result in new temporary files left after the tests. Test_expect_equal_file used to move files only on failure, so callers had to cleanup them anyway.
* Render all parts of multipart/encrypted when decrypting.Gravatar Jameson Graef Rollins2011-05-27
| | | | | | | | | | | | The primary goal here is to keep the decrypted output as similarly structured as undecrypted output as possible. Now, when decrypting parts, only the original encrypted part is replaced by the it's decrypted content. If this part isn't itself a multipart, then all part numbering should remain consistent during decryption. The only draw back here is that the useless application/pgp-encrypted sub-part of the multipart/encrypted part is also emitted. But this part can be easily ignored by clients.
* Do not replace multipart/signed part with content part when doing verification.Gravatar Jameson Graef Rollins2011-05-27
| | | | | | | | | | | Some folks have complained about the part renumbering that occurs when the entire multipart/signed part is replaced with the part contents after verification. This is primarily because it incurs an additional computational cost to retrieve individual parts, since verification has to be performed again to ensure that part numbering is consistent. This patch simply leaves the full multipart/signed part as is. The emacs crypto test is also updated to reflect this change.
* tag signed/encrypted during notmuch newGravatar Jameson Graef Rollins2011-05-27
| | | | | | | | This patch adds the tag "signed" to messages with any multipart/signed parts, and the tag "encrypted" to messages with any multipart/encrypted parts. This only occurs when messages are indexed during notmuch new, so a database rebuild is required to have old messages tagged.