aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
Commit message (Collapse)AuthorAge
...
* emacs: show: mark tags changed since buffer loadedGravatar Mark Walters2014-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows (and requires) the original-tags to be passed along with the current-tags to be passed to notmuch-tag-format-tags. This allows the tag formatting to show added and deleted tags.By default a removed tag is displayed with strike-through in red (if strike-through is not available, eg on a terminal, inverse video is used instead) and an added tag is displayed underlined in green. If the caller does not wish to use the new feature it can pass current-tags for both arguments and, at this point, we do exactly that in the three callers of this function. Note, we cannot tidily allow original-tags to be optional because we would need to distinguish nil meaning "we are not specifying original-tags" from nil meaning there were no original-tags (an empty list). We use this in subsequent patches to make it clear when a message was unread when you first loaded a show buffer (previously the unread tag could be removed before a user realised that it had been unread). The code adds into the existing tag formatting code. The user can specify exactly how a tag should be displayed normally, when deleted, or when added. Since the formatting code matches regexps a user can match all deleted tags with a ".*" in notmuch-tag-deleted-formats. For example setting notmuch-tag-deleted-formats to '((".*" nil)) tells notmuch not to show deleted tags at all. All the variables are customizable; however, more complicated cases like changing the face depending on the type of display will require custom lisp. Currently this overrides notmuch-tag-deleted-formats for the tests setting it to '((".*" nil)) so that they get removed from the display and, thus, all tests still pass.
* doc: build man pages into hierarchy, fix help test.Gravatar David Bremner2014-03-18
| | | | | | | | | It turns out there was a reason the old man pages were stored in a man compatible hierarchy, namely so that we could run man on them before installing. Hardcode doc build location into test suite. This isn't ideal, but let's unbreak the test suite for now.
* test: add machinery to download and verify databasesGravatar David Bremner2014-03-11
| | | | | Note that it is intentional that the checksum file is not downloaded. The intent is to check those into git.
* test: commit database checksum, ignore actual databasesGravatar David Bremner2014-03-11
| | | | | | | | | The checksum file is used by the test infrastructure to verify the downloaded test database is the one we had in mind. Note that this test is rather strict, and the the checksum file needs to be recommitted when the database is regenerated. add a pattern .gitignore to ignore the actual databases
* test: add database upgrade test from format version 1 to 2Gravatar Jani Nikula2014-03-11
| | | | | | | | | | | | | | | | | Test the upgrade from probabilistic to boolean folder: terms, and addition of path: terms. The test depends on the pre-built test corpus and database tarball and checksum file being in place. If it's not, the test is skipped. The mechanism to fetch the test database will be added later. At the time of writing, a working test database and checksum file is available at http://notmuchmail.org/releases/test-databases/ It has been noted that some non-GNU environments make lack sha256sum. We leave this portability issue for a followup patch.
* test: add tests for the new boolean folder: and path: prefixesGravatar Jani Nikula2014-03-11
| | | | | Additional tests for the boolean folder: and path: prefixes using the full corpus.
* lib: make folder: prefix literalGravatar Jani Nikula2014-03-11
| | | | | | | | | | | | | | | | | | | | | In xapian terms, convert folder: prefix from probabilistic to boolean prefix, matching the paths, relative from the maildir root, of the message files, ignoring the maildir new and cur leaf directories. folder:foo matches all message files in foo, foo/new, and foo/cur. folder:foo/new does *not* match message files in foo/new. folder:"" matches all message files in the top level maildir and its new and cur subdirectories. This change constitutes a database change: bump the database version and add database upgrade support for folder: terms. The upgrade also adds path: terms. Finally, fix the folder search test for literal folder: search, as some of the folder: matching capabilities are lost in the probabilistic to boolean prefix change.
* test: make insert test use the path: prefixGravatar Jani Nikula2014-03-11
| | | | This is a more strict test for the insert test.
* test: rearrange the test corpus into subfolders, fix testsGravatar Jani Nikula2014-03-11
| | | | | | | | | | | | | | We will need this for improved folder search tests, but having some folders should exercise our code paths better anyway. Modify the relevant test accordingly to make it pass. This reorganization triggers a bug in the test suite, namely that it expects the output of --output=files to be in a certain order. So we add the fix for that into the same commit. This mainly involves sorting, although the case --duplicate=$n requires more subtlety.
* test: add notmuch_search_files_sanitize and use itGravatar Jani Nikula2014-03-11
| | | | We do this in a lot of places, so make it a helper in the test-lib.
* test: add utility function to sort a json listGravatar David Bremner2014-03-11
| | | | So far we only need this one place, but it's a bit messy to inline
* cli: sanitize tabs and newlines to spaces in notmuch searchGravatar Jani Nikula2014-03-09
| | | | | | | | | Sanitize tabs and newlines to spaces rather than question marks in --output=summary --format=text output. This will also hide any difference in unfolding a header that has been folded with a tab. Our own header parser replaces tabs with spaces, while gmime would retain the tab.
* support for generating decreasing dates in bash 4.0 and 4.1Gravatar Tomi Ollila2014-03-09
| | | | | | | | The printf builtin "%(fmt)T" specifier (which allows time values to use strftime-like formatting) is introduced in bash 4.2. Trying to execute this in pre-4.2 bash will fail -- and if this happens execute the fallback piece of perl code to do the same thing.
* test: NOTMUCH_SKIP_TESTS accepts test names with or without Tddd- prefixGravatar Tomi Ollila2014-03-09
| | | | | | | | | | The test names assigned to NOTMUCH_SKIP_TESTS variable can now be given with or without the Tddd- prefix for tester convenience: The test name without Tddd -prefix stays constant even when test filenames are renumbered. The test name with Tddd -prefix is printed out when tests run.
* test: don't use $(dir) in recipes.Gravatar David Bremner2014-03-09
| | | | | | | According the semantics of make, the expansion of $(dir) in recipes uses dynamic scope, i.e. the value at the time the recipe is run. This means if test/Makefile.local is not the last sub-makefile included, all heck breaks loose.
* test: Print the number of the test along with its nameGravatar Austin Clements2014-03-06
| | | | | | | Previously, we stripped the "Tnnn-" part from the test name when printing its description at the beginning of each test. However, this makes it difficult to find the source script for a test (e.g., when a test fails). Put this prefix back.
* test: add tests for invalid new.tagsGravatar Jani Nikula2014-03-06
| | | | Similar tests for both notmuch new and insert.
* test: Simplify CLEAN list constructionGravatar Austin Clements2014-02-25
| | | | | Construct as much of the CLEAN list from TEST_BINARIES as possible, rather than duplicating this information by hand.
* emacs: update alist for mail-archive.com API changeGravatar Jed Brown2014-02-16
| | | | | | | | Searching by Message-Id no longer works via the old mail-archive.com API, though I have contacted them in hopes that they restore it to prevent dead links. Anyway, the new API is cleaner. Acked-by: Austin Clements <amdragon@MIT.EDU>
* test: add basic tests for notmuch new --quiet optionGravatar Jani Nikula2014-01-27
| | | | | This does not cover all the possible paths notmuch new could output stuff, but it's better than nothing.
* notmuch-show: detect NULL pointer returned from notmuch_query_search_threadsGravatar David Bremner2014-01-24
| | | | We want to return an error status, not 0 or (worse) segfault.
* test: add known broken test exit code of notmuch showGravatar David Bremner2014-01-24
| | | | | This test catches a segfault on a syntactically invalid query. It also catches a problem with my initial fix, which still returned 0.
* test: leave T\d\d\d- in variable $this_test and introduce $this_test_bareGravatar Tomi Ollila2014-01-18
| | | | | | | | | | | | Script `notmuch-test` expects the results file have T\d\d\d- part intact so the results files (and some test output files) are now name as such. Without this change `notmuch-test` will exit in case the test script it was executing exited with nonzero value. The T\d\d\d- part is dropped in new variable $this_test_bare which is used in progress informational messages and when loading .el files in emacs tests (whenever $this_test_bare.el exists).
* test: add test for syntax of emacs test libraryGravatar David Bremner2014-01-13
| | | | | | | | If there is a syntax error in the emacs test library, it causes other tests to hang or crash without a useful error message. This test could be eliminated if the error reporting for emacs tests was somehow improved.
* test: renamed test scripts to format T\d\d\d-name.shGravatar Tomi Ollila2014-01-13
| | | | | | | | All test scripts to be executed are now named as T\d\d\d-name.sh, numers in increments of 10. This eases adding new tests and developers to see which are test scripts that are executed by test suite and in which order.
* test: basic: drop 'ensure all available tests are run'Gravatar Tomi Ollila2014-01-13
| | | | | | | | | When naming test scripts in format 'T\d\d\d-name.sh' the list of tests to run are created dynamically. This makes test 'Ensure that all available tests will be run by notmuch-test' in test/basic obsolete.
* emacs: tree remove comma separator tagsGravatar Mark Walters2014-01-13
| | | | | | | | | | | | Previously the tags on each line in tree view were separarted by ", " not just " ". This is different from show and search views. This patch removes this comma. This is a large patch as essentially every line of each of the expected outputs in the tree tests needs updating. Apart from aesthetic reasons this simplifies the switch to notmuch-tag-format-tags in the next patch.
* Merge tag 'debian/0.17-3'Gravatar David Bremner2014-01-12
|\ | | | | | | uploaded to Debian unstable
| * test/emacs: replace the use of process-attributes with signal-processGravatar David Bremner2014-01-12
| | | | | | | | | | | | | | | | | | | | In some environments (at least Hurd), process-attributes is unimplimented and always returns nil. This ends up causing test failures (see e.g. id:87a9ffofsc.fsf@zancas.localnet). Historically and according to POSIX 1003.1-2001, a signal of 0 can be used to check the validity of a pid. This seems less heinous than parsing the output of ps(1).
* | insert: respect maildir.synchronize_flagsGravatar Jani Nikula2014-01-03
| | | | | | | | Don't synchronize maildir flags if the user doesn't want it.
* | test: notmuch insert with maildir.synchronize_flags=falseGravatar Jani Nikula2014-01-03
| | | | | | | | Known broken, notmuch insert does not respect the config option.
* | test: tree: pick remnants removedGravatar Mark Walters2014-01-03
| | | | | | | | | | Some no longer needed traces of pick remain in the emacs-tree test. Remove these.
* | Merge tag '0.17_rc4'Gravatar David Bremner2013-12-28
|\| | | | | | | notmuch 0.17~rc4 release
| * test: Fix transient error in 'new' testGravatar Austin Clements2013-12-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a non-deterministic failure in "Ignore files and directories specified in new.ignore (multiple occurrences)". The test assumed that all directories would be scanned, even though nothing updated the mtime of ${MAIL_DIR}. It *usually* worked nevertheless because the tests run quickly enough that the directory mtime is usually the same as the current time, so notmuch new does not update the mtime in the database (because more changes could occur in the same second). However, when it occasionally did update the mtime in the database, the notmuch new call in this test would (correctly) skip "pass 2" of scanning ${MAIL_DIR}, causing it to skip the following expected lines: (D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/.git (D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/.ignored_hidden_file (D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/ignored_file This patch fixes this problem by touching ${MAIL_DIR} to ensure it gets scanned and by rearranging the test to ensure the directories are touched immediately before the main notmuch new call in the test.
| * test: remove call to notmuch-hello from emacs_deliver_messageGravatar David Bremner2013-12-22
| | | | | | | | | | | | | | There is an obscure bug in notmuch-hello that very occasionally causes emacs_deliver_message to fail. Since it it doesn't serve any actual purpose in the function we delete it, and leave tracking down the the bug for another day.
| * test: add emacs_fcc_message that does not use smtp-dummyGravatar David Bremner2013-12-22
| | | | | | | | | | | | | | Most of the tests previously using emacs_deliver_message do not use the actual transmitted message, so we replace it with a simpler (and presumably more reliable function) that only saves (and indexes) an fcc copy of the message.
* | test: implement and document NOTMUCH_TEST_QUIET variable usageGravatar Tomi Ollila2013-12-09
| | | | | | | | | | | | When NOTMUCH_TEST_QUIET environment variable is set to non-null value messages when new test script starts and when test PASSes are disabled. This eases picking the cases when tests FAIL (as those are still printed).
* | test: print empty line at the beginning of test script, not at endGravatar Tomi Ollila2013-12-09
| | | | | | | | | | | | In preparation for quiet mode print empty line before writing the test description. This is done now in function designed for it -- it will also be called when test fails.
* | test: resolve `basename "$0" .sh` once for all in test-lib.shGravatar Tomi Ollila2013-12-09
| | | | | | | | | | | | | | | | | | | | test-lib.sh sometimes did equivalent of `basename "$0" .sh`, sometimes skipping the basename part and sometimes .sh part. This worked as we never had path components in $0 (more than ./) nor .sh ending. Now the equivalent of `basename "$0" .sh` is done once and used everywhere. In the future we may have .sh suffix in test names -- removing those is a good idea.
| * test: give unique timestamps to messagesGravatar David Bremner2013-12-09
| | | | | | | | | | | | The choice of decreasing timestamps is a hack which reduces the number of existing tests which fail. This can be changed to increasing if/when somebody wants update another 47 tests.
| * test: sanitize dates in emacs, raw, and text outputGravatar David Bremner2013-12-09
| | | | | | | | | | | | | | add a new function notmuch_date_sanitize for rfc822-ish things. Add date sanitization to notmuch_show_sanitize_all and use it more places. This is all in aid of a transition to unique timestamps on messages.
| * test: sanitize Date and timestamp fields in jsonGravatar David Bremner2013-12-09
| | | | | | | | | | | | | | | | | | Eventually we want test messages to have distinct dates to avoid reproducability problems. This sanitization will prevent some test failures when that change is made. Replace the use of a local function in maildir-sync with notmuch_json_show_sanitize
| * test: pass expected output through json_sanitize in 2 placesGravatar David Bremner2013-12-09
|/ | | | | This makes the tests more robust against changes in the sanitization rules.
* test/crypto: disable gpg version printingGravatar David Bremner2013-11-28
| | | | | | This was causing test failures because version strings varied in length between GNU/Linux and GNU/KFreeBSD. One can also imagine different versions of gnupg causing the same failure.
* test: replace $PWD with YYY in emacs & emacs-show testsGravatar David Bremner2013-11-23
| | | | | | | | | | | | | | When executed command line is written to *Notmuch errors* buffer, shell-quote-argument will backslash-escape any char that is not in "POSIX filename characters" (i.e. matching "[^-0-9a-zA-Z_./\n]"). Currently in two emacs tests shell has expanded $PWD as part of emacs variable, which will later be fed to #'shell-quote-argument and finally written to ERROR file. If $PWD contained non-POSIX filename characters, data in ERROR file will not match $PWD when later comparing in shell. Therefore, in these two particular cases the escaped $PWD is replaced with YYY in ERROR file and expected content is adjusted accordingly.
* emacs: Fix search tagging racesGravatar Austin Clements2013-11-08
| | | | | | | | | | | | | | This fixes races in thread-local and global tagging in notmuch-search (e.g., "+", "-", "a", "*", etc.). Previously, these would modify tags of new messages that arrived after the search. Now they only operate on the messages that were in the threads when the search was performed. This prevents surprises like archiving messages that arrived in a thread after the search results were shown. This eliminates `notmuch-search-find-thread-id-region(-search)' because these functions strongly encouraged racy usage. This fixes the two broken tests added by the previous patch.
* emacs: Add known-broken tests for search tagging racesGravatar Austin Clements2013-11-08
| | | | | | These tests check that both thread-local and global search tagging operations are race-free. They are currently known-broken because they aren't race-free.
* search: Add stable queries to thread search resultsGravatar Austin Clements2013-11-08
| | | | | | | | | | | | | | These queries will match exactly the set of messages currently in the thread, even if more messages later arrive. Two queries are provided: one for matched messages and one for unmatched messages. This can be used to fix race conditions with tagging threads from search results. While tagging based on a thread: query can affect messages that arrived after the search, tagging based on stable queries affects only the messages the user was shown in the search UI. Since we want clients to be able to depend on the presence of these queries, this ushers in schema version 2.
* emacs: Use notmuch tag --batch for large tag queriesGravatar Austin Clements2013-11-08
| | | | | | (Unfortunately, it's difficult to first demonstrate this problem with a known-broken test because modern Linux kernels have argument length limits in the megabytes, which makes Emacs really slow!)
* test: Fix missing erase-buffer in emacs testGravatar Austin Clements2013-11-08
| | | | | The first subprocess error exit code test assumed the *Notmuch errors* buffer would be empty. Rather than assuming, make it so.