aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
Commit message (Collapse)AuthorAge
* 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.
* test: add crypto tests for signature verification and decryptionGravatar Jameson Graef Rollins2011-05-27
| | | | | | | | | | | | | | | | | | | This adds a new "crypto" test script to the test suite to test PGP/MIME signature verification and message decryption. Included here is a test GNUPGHOME with a test secret key (passwordless), and test for: * signing/verification * signing/verification with full owner trust * verification with signer key unavailable * encryption/decryption * decryption failure with missing key * encryption/decryption + signing/verfifying * reply to encrypted message * verification of signature from revoked key These tests are not expected to pass now, but will as crypto functionality is included.
* test: add notmuch_show_sanitize_all function that is a little more aggressive.Gravatar Jameson Graef Rollins2011-05-27
| | | | | | The old notmuch_show_sanitize function only scrubed part of the filename. This one scrubs the full filename, as well as the message id.
* test: new test-lib function to test for equality between filesGravatar Jameson Graef Rollins2011-05-27
| | | | | | | | | | We need to be able to test for the presence of a newline at the end of output. There's no good way to capture trailing newlines in bash, so redirecting output to a file is the next best thing. This new function should be used when testing for output that is expected to have trailing newlines. The next commit will demonstrate the use of this.
* test: use `princ' instead of `message' calls in emacs testsGravatar Dmitry Kurochkin2011-05-27
| | | | | | | | | | | | | | | | The patch replaces all (message (buffer-string)) calls in emacs tests with (princ (buffer-string)). This avoids accidentally interpreting '%' as format specifiers and makes code simpler because we do not need to capture stderr. Also, the patch works around an Emacs (23.3+1-1 on current Debian Unstable) segfault in "Ensure that emacs doesn't drop results" test. Note: the segfault does not happen on every test run. Though, it seems to be consistently reproducible if the test uses 300 messages instead of 30. Hopefully, it is the crash described in Emacs bug #8545 [1] which is already fixed. [1] http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8545
* Update some more recent tests to use /usr/bin/env to find bashGravatar Carl Worth2011-05-27
| | | | | The recentl-applied patch had grown stale, so update the tests that had been created since it was originally written.
* test: change "#!/bin/bash" to "#!/usr/bin/env bash" enhances portabilityGravatar Joel Borggrén-Franck2011-05-27
| | | | | | Change #!/bin/bash at start of tests to "#!/usr/bin/env bash". That way systems running on bash < 4 can prepend bash >= 4 to path before running the tests.
* test: add test-lib.el file with `visible-buffer-string' functionGravatar Dmitry Kurochkin2011-05-26
| | | | | | | | | | | | | The patch adds test-lib.el file for Emacs tests auxiliary stuff. Currently, it implements two functions: `visible-buffer-string' and `visible-buffer-substring'. These are similar to standard counterparts without "visible-" prefix but exclude invisible text. The functions are not used anywhere at the moment but should be useful for testing hiding/showing in the Emacs interface. Edited-by: Carl Worth <cworth@cworth.org> Fixed "basic" test to ignore new test-lib.el file.
* test: add test for hiding/showing signature in notmuch-show viewGravatar Dmitry Kurochkin2011-05-24
|
* test: fix expected output for emacs tests after the wash button label changesGravatar Dmitry Kurochkin2011-05-24
|
* test: Expand multipart test to cover "notmuch reply" as wellGravatar Carl Worth2011-05-24
| | | | | This gives coverage for the segmentation fault in "notmuch reply" that was just fixed with the previous commit.
* test: Expand multipart test to cover part output in all formats.Gravatar Jameson Graef Rollins2011-05-24
| | | | | | The example multipart message is made a bit more complicated by adding a message/rfc822 message, and the all parts are output and tested in all output formats.
* test: force deletion of test remnantsGravatar Jameson Graef Rollins2011-05-23
| | | | | | This keeps the test from failing if only a subset of the remnants were available for deletion, because e.g. only a subset of the tests were run.
* test: allow specifying tests to run with NOTMUCH_TESTS env varGravatar Jameson Graef Rollins2011-05-23
| | | | | | This is useful for just running a specific subset of tests, ie: NOTMUCH_TESTS=crypto make test
* test: remove hard-coded paths from multipart testGravatar Jameson Graef Rollins2011-05-20
| | | | Small oversite, easily corrected.
* emacs: Show cleaner `From:' addresses in the summary line.Gravatar David Edmondson2011-05-18
| | | | | | | | | | Remove double quotes and flatten "foo@bar.com <foo@bar.com>" to "foo@bar.com". Edited-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net> (clean up expected output for emacs tests). Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
* test: Link to compat files when building program during "make test"Gravatar Carl Worth2011-05-18
| | | | | | | The compilation of the smtp-dummy program would fail if a build was attempted on a system without getline. Fix this by simply including the existing notmuch_compat_srcs variable when constructing the list of source files for compiling smtp-dummy.
* notmuch show: Properly nest MIME parts within mulipart partsGravatar Carl Worth2011-05-17
| | | | | | | | | | | | | | | | | | | | | | | Previously, notmuch show flattened all output, losing information about the nesting of the MIME hierarchy. Now, the output is properly nested, (both in the --format=text and --format=json output), so that clients can analyze the original MIME structure. Internally, this required splitting the final closing delimiter out of the various show_part functions and putting it into a new show_part_end function instead. Also, the show_part function now accepts a new "first" argument that is set not only for the first MIME part of a message, but also for each first MIME part within a series of multipart parts. This "first" argument controls the omission of a preceding comma when printing a part (for json). Many thanks to David Edmondson <dme@dme.org> for originally identifying the lack of nesting in the json output and submitting an early implementation of this feature. Thanks as well to Jameson Graef Rollins <jrollins@finestructure.net> for carefully shepherding David's patches through a remarkably long review process, patiently explaining them, and providing a cleaned up series that led to this final implementation. Jameson also provided the new emacs code here.
* notmuch show: Include output for the enclosing multipart part of a MIME mailGravatar Carl Worth2011-05-17
| | | | | | | | | | | | | | | | | Previously, the outer multipart part of any multipart/mixed, multipart/signed, etc. MIME message was silently omitted from the "notmuch show" output. This prevented any client from correctly determining to which parts a signature applies, for example. Now, we actually emit these parts as their own parts. The output is still flattened---the contained parts are not yet included "within" the multipart part---so it's still not possible to determine to which parts a signature applies, but this is one step along the path. The test suite is updated to reflect this change, (though we'll eventually want to fix the emacs interface to not display buttons for the multipart enclosure parts as there's nothing useful for the user to actually do with them).
* test: Add a test of "notmuch show" with a multipart messageGravatar Carl Worth2011-05-16
| | | | | | | | | | | | This tests "notmuch show" with both --format=text and --format=json on a message with some non-trivial MIME multipart nesting, (multiple parts within a multipart/mixed part which is within a multipart/signed part). The test captures the current behavior (where only the leaf nodes of the MIME structure are emitted as a flat list---the multipart parts are effectively ignored). We plan to soon change the json output at least to emit an actual hierarchy matching the MIME structure, (at which point we will update this test).
* test: Mark the search-insufficient-from-quoting tests to expect successGravatar Carl Worth2011-04-25
| | | | | | Theses were expected failures only due to a bug in GMime (with versions of GMime before 2.4.18). As of GMime version 2.4.18 this bug is fixed and these tests now pass.
* emacs: Don't drop error messages from "notmuch search"Gravatar Carl Worth2011-03-10
| | | | | | | | | | | | | With the previous commit, unexpected output before or between search results would be displayed. However, trailing junk from the "notmuch search" output would still be silently swallowed. The most common case for an error message from "notmuch search" would be an invalid command-line, and in that case, there would be no search results and the trailing error message would get swallowed. We fix the process sentinel to check for leftover data and add it to the final buffer. We also add a test case to ensure this works.
* emacs: Display any unexpected output from notmuch searchGravatar Carl Worth2011-03-10
| | | | | | | | | | | | | | Rather than silently swallowing unexpected output, the emacs interface will now display it. This will allow error messages to actually arrive at the emacs interface (though not in an especially pretty way). This also allows for easier investigation of the inadvertent swallowing of search results that span page boundaries (as demonstrated by the recent added emacs-large-search-buffer test). The page-boundary bug has been present since a commit from 2009-11-24: 93af7b574598637c2766dd1f8ef343962c9a8efb Many thanks to Thomas Schwinge for tracking that bug down and contributing the test for it.
* Rename/rewrite the new emacs-forgetfulness test (to emacs-large-search-buffer)Gravatar Carl Worth2011-03-10
| | | | | | | | The new name is more descriptive of the bug being tested. Also, the test is rewritten slightly so that it's much more plain to see how the bug manifests itself, (that messages are droped from the emacs result at regular intervals). Primarily, this is by collapsing the large blobs used to inflate the message subjects.
* New test: Emacs' forgetfulness.Gravatar Thomas Schwinge2011-03-10
| | | | Signed-off-by: Thomas Schwinge <thomas@schwinge.name>
* json: Fix search result with no matches to be a valid json object.Gravatar Carl Worth2011-03-09
| | | | | | | | In the original json code, search matching nothing would return a valid, empty json array (that is, "[]"). I broke this in commit 6dcb7592e32ed5140ea0c0357ce78d6a37af6066 when adding support for --output=threads|messages|tags. This time, while fixing the bug also add a test to the test suite to help avoid future regressions.
* test: Rename and clarify the search-lwn testGravatar Carl Worth2011-03-09
| | | | | | | | Now that we understand the bug here, we rename this test to search-insufficient-from-quoting to clarify the bug being exercised, (which occurs when the From: line contains an unquoted '.' character). We also mark these tests as expected failures until the bug gets fixed.
* search: Move lwn tests into their own file.Gravatar Carl Worth2011-03-09
| | | | | Since it's much easier to debug and fix these if they can be run on their own.
* Add a few tests for searching LWN emails.Gravatar Thomas Schwinge2011-03-09
| | | | | | These tests should pass -- but they currently don't. Signed-off-by: Thomas Schwinge <thomas@schwinge.name>
* Clarify usage of `additional_headers' in test/test-lib.sh:generate_message.Gravatar Thomas Schwinge2011-01-28
| | | | Signed-off-by: Thomas Schwinge <thomas@schwinge.name>
* test: Make it easier to resolve conflicts when adding new testsGravatar Michal Sojka2011-01-26
| | | | | | | | | | | Currently, there are two places in the test framework that contain very long list on a single line. Whenever a test is added (or changed) in several branches and these branches are merged, it results in conflict which is hard to resolve because one has to go through the whole long line to find where the conflict is. This patch splits these long lists to several lines so that the conflicts are easier to resolve.
* Add test demonstrating a position overlap bug.Gravatar Carl Worth2011-01-26
| | | | | | | | | | | | | | | Currently, whenever we call index_terms multiple times for a single field, the term generator is being reset to position 0 each time. This means that with text such as: To: a@b.c, x@y.z one can get a bogus match by searching for: To: a@y.c Thanks to Mark Anderson for reporting the bug, (and providing a nice, minimal test case that inspired what is used here).
* test: Add new tests for folder-based searching.Gravatar Carl Worth2011-01-15
| | | | | | | | | | This is a new feature which is not implemente yet, so these tests mostly fail currently. A subsequent commit will add the feature and cause these tests to start passing. These tests verify that we can search for containing folders of mail files by word or by phrase and that the search terms are updated correctly when directories are renamed.
* Fix misspelling in a comment.Gravatar Carl Worth2011-01-15
| | | | Just a simple change I noticed in passing.
* test/basic: Ignore new files ending in ~Gravatar Carl Worth2011-01-15
| | | | | We don't need to complain that temporary editor backups are not added to the list of tests to be run.
* Update test suite for 7 tests that were recently fixed.Gravatar Carl Worth2010-12-07
| | | | | These tests had been broken, but were fixed by the preceding commit, so update the test suite to print PASS rather than FIXED for these.
* Revert "test: Break on test script (or other) error"Gravatar Carl Worth2010-12-07
| | | | | | | | This reverts commit f22a7ec1e28d1264cf9d67d78796b8ab22e09a35. Interrupting the test suite due to an actual bug in a test script would be just fine, but interrupting the run of the entire test suite at the first test failure is unacceptable.
* test: Leave tmp.<testname> for broken testsGravatar Carl Worth2010-12-07
| | | | | | Previously, this directory was only preserved for failing tests. But it's important to be able to easily debug known-broken tests, so preserve the actual vs. expected output for those as well.
* Make author order tests more strict.Gravatar Austin Clements2010-12-07
| | | | | | | | | | | | Use varying dates in the test messages to test the order authors are listed in. Add tests with repeated author names and unusual date ordering. Most of these are broken at the moment, but will be fixed shortly. Edited-by: Carl Worth <cworth@cworth.org>: Also update the expected results for existing emacs tests that currently codify the incorrect author ordering, (and similarly note them as broken in the current test suite).
* Fix handling of broken tests.Gravatar Austin Clements2010-12-07
| | | | | Make sure to close the subtest for test_expect_equal_failure, just like in test_expect_equal.
* emacs: Improve the display of truncated authors.Gravatar David Edmondson2010-12-07
| | | | | | | | | | Incremental search does not match strings that span a visible/invisible boundary. This results in failure to correctly isearch for authors in `notmuch-search' mode if the name of the author is split between the visible and invisible components of the authors string. To avoid this, attempt to truncate the visible component of the authors string on a boundary between authors, such that the entirety of an author's name is either visible or invisible.
* test: Ignore files created during test failures.Gravatar David Edmondson2010-12-07
| | | | | | | | | When a test fails, a tmp.<testname> file is left behind. These files are useful for the person debugging the test failure, but are never anything we want to commit. Edited-by: Carl Worth <cworth@cworth.org>: Changed from tmp.emacs to tmp.* and added explanation in the commit message.
* test: Add --format=json testing to the "notmuch search --format" tests.Gravatar Carl Worth2010-11-23
| | | | | | | This testing *does* capture the bug of missing '[' and ']' characters int "notmuch search --output=tags" case. This is another manifestation of the same bug causing the missing final newline (as mentioned in the previous commit).
* test: Add simple tests for "notmuch search --output=<>"Gravatar Carl Worth2010-11-23
| | | | | | | | | | | This code simply wasn't being exercised by the test suite before, so this will be useful. Meanwhile, there's currently a bug in "notmuch search --output=tags" in that it doesn't print a final newline. But the current test suite isn't able to catch this bug since the $() construct of the shell doesn't preserve the distinction of whether the final newline is present or not.