summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* 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.
* emacs: Fix notmuch-hello to not break when given a very narrow window.Carl Worth2010-10-22
| | | | | | Simply ensure that some subtractions never result in a negative number, (since emacs complains when asked to create a string with a negative length).
* TODO: Add some notes to fix some recently noted problems.Carl Worth2010-10-12
| | | | Just don't want to forget about things that people have pointed out.
* emacs: Fix bug when parsing a subject cotaining: \[[0-9/]\]Carl Worth2010-09-23
| | | | | | That is, a subject with a bracketed set of digits (and optionally a slash), for example "[2010]" would cause the emacs code to misparse the search results. Fix this by tweaking the regular expression.
* lib: Fix "make install"Carl Worth2010-09-21
| | | | | This has been broken since the addition of the test sub-directory to our non-recursive make system.
* 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).
* test: Remove useless NOTMUCH variable (in favor of simply "notmuch")Carl Worth2010-09-20
| | | | | | | | | | When the NOTMUCH variable was originally invented it was used as an explicit path to the notmuch binary being tested. Today, the test suite sets the PATH variable instead, so the NOTMUCH variable always has a value of simply "notmuch". We simplifying that by using the constant value rather than the continual variable reference.
* test: Remove some dead code in test-lib.shCarl Worth2010-09-20
| | | | | These assignements weren't being used at all and were just confusing me, (the real assignments happen later on in the file).
* test: Fix PATH-checking test to work with --valgrindCarl Worth2010-09-20
| | | | | The --valgrind option munges the PATH variable, so un-munge it before testing that we have PATH pointing to the source directory.
* lib: Fix use-after-free bug.Carl Worth2010-09-20
| | | | | | | Thanks to the new git-based test suite, it's easy to run the whole test suite in valgrind, (simply "make test OPTIONS="--valgrind"), and doing so showed this obvious use-after-free bug, (triggered by the thread-order tests).
* test: Fix to actually report errors (!).Carl Worth2010-09-20
| | | | | | A bug in the results-aggregation code was causing the test suite to report "all tests passed" even when there were failures, (as long as there were also no "broken" tests). Fix this.
* test: Avoid printing "Testing Testing ..."Carl Worth2010-09-20
| | | | The test suite isn't auditioning for a roadie position, after all.
* test: Print section names, and rename all test sectionsCarl Worth2010-09-20
| | | | | | | | Now that we can usefully pass section names via the NOTMUCH_SKIP_TESTS environment variable, it's useful to actually print those names out for the user. Then, since we're now printing these names, let's use nicer names, (not excessively long but also not using abbreviations like "msg").
* test: Make the --valgrind option useful, (and drop --verbose).Carl Worth2010-09-20
| | | | | | | | | In order for --valgrind to be useful, we drop noisy additional output of all of the commands being executed in verbose mode. This makes --verbose alone quite useless, so we don't document it any more. Also, add a zlib valgrind suppression that was showing up frequently in the test suite.
* test/README: Update to become notmuch-specific rather than git-specificCarl Worth2010-09-20
| | | | | | This file was obviously describing the git test suite previously, and would have been very hard to understand in the context of the notmuch test suite. HOpefully it's easier to follow now.
* test: Rename GIT_SKIP_TESTS to NOTMUCH_SKIP_TESTSCarl Worth2010-09-20
| | | | | | | | | By scanning test-lib.sh for occurrences of "git" or "GIT", I found that most of those are internal things, (like the GIT_TEST_TEE_STARTED variable). But GIT_SKIP_TESTS is part of the user-interface to the test suite, so we rename it to reference notmuch rather than git. Also, the GIT_TRACE warning is git-specific, so we drop that as well.
* test: Fix notmuch-test to pass command-line arguments to sub-scripts.Carl Worth2010-09-20
| | | | The is useful for things like "notmuch-test --valgrind", etc.
* test: Fix test suite so that --valgrind option works.Carl Worth2010-09-20
| | | | | The output is ugly, and we need a better suppressions file, but this is at least a start.
* test: Add test to ensure that all available test scripts are runCarl Worth2010-09-20
| | | | | | Since we are now using an explicit list of tests to run in notmuch-test we need to be careful that we don't add a new file of tests and then forget to add it to the list.
* test: Rename all tests to get rid of the ugly numbers in file names.Carl Worth2010-09-17
| | | | | | | The numbers were meaningless, and they made it hard to find a file of interest. Instead, we get the ordering we want by adding an explicit list of tests to run to the notmuch-test script.
* test: Remove basic testing of broken, fixed, and skipped tests.Carl Worth2010-09-17
| | | | | | | | | | | | | These were interfering with the aggregate statistics reported at the end of the test-suite run. (Always reporting 1 broken, 1 fixed, and 1 skipped). The correct way to test the test-suite itself would be to run the test suite externally for these cases, capture the expected result, and then report that as a PASS test. But, really, there's almost no value in these tests anyway. It's almost to the level of testing that 'if false; exit 1; fi' returns 1. That is, there are so many ways that the test suite could be broken internally, that these minor tests don't really help.
* test: Fix ordering of tests in t0000-basic.shCarl Worth2010-09-17
| | | | | The basic notmuch tests depend on the test-suite harness working, so test it first.
* test: Rework test-suite input to avoid ulti-command stringsCarl Worth2010-09-17
| | | | | | | | | | | | | | The original git test suite works by concatenating many commands into a very long string (each separated by &&). This is painful to work with since it prevents the editor from helping by parsing the shell script, indenting, colorizing, etc. Instead, we switch this back to something like the original notmuch test suite, and add two new functions to test-lib.sh (test_begin_subtest and test_expect_equal) to support these. This also fixes the test suite to once again display the diff when a test fails to generate the expected input.
* test: Cleanup the test outputCarl Worth2010-09-17
| | | | | | | | | | | | | | | | This makes the new, git-derived test suite report results in a manner similar to the original notmuch test suite. Notable changes include: * No more initial '*' on every line * Only colorize a single word * Don't print useless test numbers * Use "PASS" in place of "ok" * Begin sentences with a capital letter * Print test descriptions for each block * Separate each block of tests with a blank line * Don't summarize counts between each block
* test: Fix test suite to integrate with our non-recursive Makefile system.Carl Worth2010-09-17
| | | | | | | This avoids "make test" emitting messages from three (3!) recursive invocations of make. We change the invocations of the tests themselves to occur directly from the shell script rather than having the shell script invoke make again and using wildcards in the Makefile.
* test: Set all times to UTCMichal Sojka2010-09-16
| | | | | | | | In order to have repeatable test suite, all times in messages are set to UTC time zone to match the time zone (TZ variable) set in test-lib.sh. Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
* Convert the actual tests to the new frameworkMichal Sojka2010-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The changes are: - The notmuch-test was split into several files (t000?-*.sh). - Removed helper functions which were moved to test-lib.sh - Replaced every printf with test_expect_success. - Test commands chained with && (test-lib.sh doesn't use "set -e" in order to complete the test suite even if something fails) - Many variables such as ${MAIL_DIR} were properly quoted as they contain spaces. - Changed quoting patterns in add_message and generate_message (single quotes are already used by the test framework). - ${TEST_DIR} replaced by ${PWD} QUICK HOWTO: To run the whole test suite make To run only a single test ./t0001-new.sh To stop on the first error ./t0001-new.sh -i then mail store and database can be inspected in "trash directory.t0001-new" To see the output of tests ./t0001-new.sh -v To not remove trash directory at the end: ./t0001-new.sh -d To run all tests verbosely: make GIT_TEST_OPTS="-v" Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
* test: Update helper functionsMichal Sojka2010-09-16
| | | | | | | | | | Modify the helper functions to work with git-based test suite i.e. 1) Quote arguments where it is necessary. 2) Do not use $NOTMUCH. It is equal to "notmuch" since $PATH is set to the build tree. 3) Modify pass_if_equal to fit into the git-based test suite. Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
* Update test framework for use with notmuchMichal Sojka2010-09-16
| | | | | | | | This removes Git specific things from the test-lib.sh and adds helper functions for notmuch taken from Carl's notmuch-test script. README is also slightly modified to reflect the current state. Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
* Copy test framework from GitMichal Sojka2010-09-16
| | | | | | | | | | | Git uses a simple and yet powerful test framework, written in shell. The framework is easy to use for both users and developers so I think it would help if it is used in notmuch as well. This is a copy of Git's test framework from commit b6b0afdc30e066788592ca07c9a6c6936c68cc11 in git repository. Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
* emacs: Allow '|' to operate on multiple messages (by means of prefix argument).Carl Worth2010-09-16
| | | | | | We extend the '|' command so that passing a prefix argument, (for example, "C-u |"), causes it to pipe all open messages in the current thread rather than just the single, current message.
* notmuch show: Add documentation of --format=mboxCarl Worth2010-09-16
| | | | | Shame on me for adding a feature without documenting it at the same time.
* emacs: Fix line-wrapping for help message of notmuch-show mode.Carl Worth2010-08-19
| | | | | | This was previously wrapped for unsubtituted command names. It looks much better in the notmuch-help (available with '?') if wrapped according to the length of the substituted command names.
* Avoid segmentation fault with NOTMUCH_CONFIG=/new/config/file notmuch setupCarl Worth2010-07-19
| | | | | | | | | | | | | | | | | | | | | | | Since commit f41a35e2923b0b3ef2f66e91cd30e20b4c1a336a running a command such as: NOTMUCH_CONFIG=/new/config/file notmuch setup would result in a segmentation fault. The purpose of that commit was to ensure that an attempt to manipulate a non-standard database would not inadvertently manipulate the default database only due to a typo in the NOTMUCH_CONFIG environment variable. That is, a command like: NOTMUCH_CONFIG=mistyped-config-filename notmuch tag -new tag:new shouldn't modify the database at ${HOME}/mail, but should instead simply report that the mistype configuration filename does not exist. We fix both cases simultaneously by reporting the error message whenever the function calling notmuch_config_open is not explicitly prepared for a default configuration file.
* NEWS: Document the new "notmuch show --format=mbox" formatCarl Worth2010-06-08
| | | | I'm trying to get into the habit of maintaining the NEWS file as I go.
* notmuch show: Add a --format=mbox optionCarl Worth2010-06-08
| | | | | | | | | | | | | | | | | | | | | We don't love the mbox format, but it's still sometimes the most practical way to share a collection of messages as a single file. Here we implement the "mboxrd" variant of the mbox file format. This variant applies reversible escaping by prefixing a '>' character to all lines in the email messages matching the regular expression: "^>*From " This allows the escaping to be reliably removed. A reader should remove a '>' from any line matching the regular expression: "^>>*From " More details on the mboxrd formats (and others as well) can be found here: http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/mail-mbox-formats.html
* Fix minor style issues in show_part_content function.Carl Worth2010-06-05
| | | | | I was recently editing the code in this function and decided to clean it up a bit.
* Avoid giving GMime a NULL MIME-stream filter.Carl Worth2010-06-05
| | | | | | | | | | | | | | | | | | | | Micah Anderson reported an issue where a message failed to display in the emacs interface, (it instead gave an error, "json-read-string: Bad string format"). Micah tracked this down to the json output from "notmuch show" being interrupted by a GMime error message: gmime-CRITICAL **: g_mime_stream_filter_add: assertion `GMIME_IS_FILTER (filter) I tracked this down further to notmuch passing a NULL value to g_mime_stream_filter_add. And this was due to calling g_mime_filter_charset_new with a value of "unknown-8bit". So we add a test message withe a Conten-Type of "text/plain; charset=unknown-8bit" from Micah's message. Then we fix "notmuch show" to test for NULL before calling g_mime_stream_filter_add. Bug fixed.
* Add C-tab binding in notmuch-search mode as well.Carl Worth2010-06-04
| | | | | We recently added this to notmuch-hello mode so we might as well support it in this mode as well for consistency.