summaryrefslogtreecommitdiff
path: root/test/test-lib.el
AgeCommit message (Collapse)Author
2016-03-26test/test-lib.el: revert setting notmuch-mua-reply-insert-header-p-functionTomi Ollila
in d27d90875dfb1 (2016-02-20) notmuch-mua-reply-insert-header-p-function was set to notmuch-show-reply-insert-header-p-never as its default was changed to something else. Now that default is set back to *-never so this change done in d27d90875dfb1 is not needed anymore.
2016-02-21emacs/mua: Let user specify which parts get a header in citations.David Edmondson
Add a customizable function specifying which parts get a header when replying, and give some sensible possiblities. These are, 1) all parts except multipart/*. (Subparts of a multipart part do receive a header button.) 2) only included text/* parts. 3) Exactly as in the show buffer. 4) None at all. This means the reply contains a mish-mash of all the original message's parts. In the test suite we set the choice to option 4 to match the previous behaviour.
2016-01-29test: initial tests for S/MIME and notmuch-emacsDavid Bremner
Test the ability of notmuch-mua-mail to send S/MIME signed (and encrypted) messages; this really relies on existing functionality in message-mode. The generated keys and messages will later be useful for testing the notmuch CLI.
2014-09-21test: New tests for Emacs charset handlingAustin Clements
The test of viewing 8bit messages is known-broken. The rest pass, but for very fragile reasons. The next several commits will fix the known-broken test and make our charset handling robust.
2014-09-21test/emacs: globally force the html renderer to html2textDavid Bremner
Previously we did this for a single test, but some other proposed tests ( id:1398105468-14317-3-git-send-email-amdragon@mit.edu ) show similar breakage when switching renderers.
2014-07-13test: make test_emacs call post-command-hookDavid Bremner
The unread/read changes will use the post-command-hook. test_emacs does not call the post-command-hook. This adds a notmuch-test-progn which takes a list of commands as argument and executes them in turn but runs the post-command-hook after each one. The caller can batch operations (ie to stop post-command-hook from being interleaved) by wrapping the batch of operations inside a progn. We also explicitly run the post-command-hook before getting the output from a test; this makes sense as this will be a place the user would be seeing the information.
2014-03-24emacs: show: mark tags changed since buffer loadedMark Walters
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.
2014-01-12test/emacs: replace the use of process-attributes with signal-processDavid Bremner
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).
2013-01-29test: delay watchdog checks in emacs.David Bremner
Instead of checking immediately for the watched process, delay a minute, or in the case that process-attributes returns nil, for two minutes. This is intended to cope with the case that process-attributes is unimplimented, and returns always returns nil. In this case, the watchdog check is the same as the two minute limit imposed by timeout.
2012-11-15test: Test buttonization of id: linksAustin Clements
This matches the current behavior of the buttonizer, so it passes, but many of these cases are not what you'd want (and some of them aren't even valid Xapian queries). The next patch will fix the handling of these cases and update the test.
2012-08-29test: emacs: run list-processes after accept-process-output in emacs 23.1Tomi Ollila
When running emacs tests using emacs 23.1.1 the tests block (until timeout) when emacs function (notmuch-test-wait) is called. There is an emacs bug #2930 titled: 23.0.92; `accept-process-output' and `sleep-for' do not run sentinel It seems this is present in emacs 23.1. Calling list-processes after accept-process-output seems work around this problem; in case Emacs version is 23.1 a defadvice is activated to do just that.
2012-08-29test: emacs: call accept-process-output in notmuch-test-waitTomi Ollila
notmuch-test-wait called sleep-for in a loop to wait unconditionally 0.1 seconds while waiting for process to exit. accept-process-output returns as soon as there is any data available from process, so using it avoids unnecessary fixed delays. Both of these functions run process sentinels.
2012-07-12test: New test for incremental search output parsingAustin Clements
This advises the search process filter to make it process one character at a time in order to test the pessimal case for incremental search output parsing. The text parser fails this test because it gets tricked into thinking a parenthetical remark in a subject is the tag list.
2012-01-26test: `notmuch-test-run' should protect against buffer switching.David Edmondson
The body of the test may cause the current buffer to change. Ensure that the output goes to the correct buffer by switching back before inserting it.
2012-01-26test: `visible-buffer-substring' should not return text properties.David Edmondson
When using `visible-buffer-substring' to examine a buffer, the text properties are not useful, so don't include them.
2012-01-25test: Add more helpers for emacs tests.David Edmondson
2012-01-25test: Add `test_emacs_expect_t'.David Edmondson
Add a new test function to allow simpler testing of emacs functionality. `test_emacs_expect_t' takes one argument - a lisp expression to evaluate. The test passes if the expression returns `t', otherwise it fails and the output is reported to the tester.
2012-01-22test: make (kill-emacs) from emacsclient work with emacs 23.(1|2)Tomi Ollila
emacsclient --eval '(kill-emacs)' makes emacs versions 23.1 and 23.2 ask user input from running emacs. Redefining yes-or-no-p function when kill-emacs is executed for these emacs versions in test-lib.el avoids this test problem.
2011-12-22test: add test for `notmuch-hello-refresh-hook'Dmitry Kurochkin
Test that `notmuch-hello-refresh-hook' is called once when `notmuch-hello' is called and twice when calling `notmuch-hello-update' after that. The tests are very similar to tests for `notmuch-hello-mode-hook'.
2011-12-22test: add general Emacs hook counterDmitry Kurochkin
Replace `notmuch-hello-mode-hook-counter' with general `hook-counter' and `add-hook-counter' functions to allow counting calls for any hook.
2011-12-20test: add `notmuch-hello-mode-hook-counter'Dmitry Kurochkin
Add `notmuch-hello-mode-hook-counter' hook to count how many times `notmuch-hello-mode-hook' was called. The counter function increments `notmuch-hello-mode-hook-counter' variable value if it is bount, otherwise it does nothing.
2011-11-05test: do not set frame width in emacsDmitry Kurochkin
No need for `set-frame-width' in emacs tests since it runs in screen now.
2011-06-28test: use emacsclient(1) for Emacs testsDmitry Kurochkin
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.
2011-06-28test: save buffer content to file instead of printing it in Emacs testsDmitry Kurochkin
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.
2011-06-28test: cleanup test_emacsDmitry Kurochkin
Move auxiliary function definition and configuration from command line to test-lib.el.
2011-05-26test: add test-lib.el file with `visible-buffer-string' functionDmitry Kurochkin
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.