aboutsummaryrefslogtreecommitdiff
path: root/test/T310-emacs.sh
AgeCommit message (Collapse)Author
2024-04-06emacs: Add new option notmuch-search-hide-excludedMohsin Kaleem
The new notmuch-search-hide-excluded option allows users to configure whether to show or hide excluded messages (as determined by search.exclude_tags in the local notmuch config file). It defaults to true for now to maintain backwards-compatibility with how notmuch-{search,tree} already worked. New commands notmuch-search-toggle-hide-excluded and notmuch-tree-toggle-exclude have also been added. They toggle the value of notmuch-search-hide-excluded for the search in the current search or tree buffer. It's bound to "i" in the respective keymaps for these modes. Lastly I've amended some calls to notmuch-tree and notmuch-unthreaded which didn't pass through the buffer local value of notmuch-search-oldest-first (and now notmuch-search-exclude). Examples of where I've done this include: + notmuch-jump-search + notmuch-tree-from-search-current-query + notmuch-unthreaded-from-search-current-query + notmuch-tree-from-search-thread A new test file for Emacs has been added which covers the usage of the new `notmuch-search-hide-excluded' option and interactively hiding or showing mail with excluded tags. These test cover the basic usage of the `notmuch-search-toggle-hide-excluded' command in notmuch-search, notmuch-tree and notmuch-unthreaded searches. These tests also cover the persistence of the current value of the hide-excluded mail option as a user switches from between these different search commands. [1]: id:87ilxlxsng.fsf@kisara.moe Amended-by: db, fix indentation in T461-emacs-search-exclude.sh
2023-07-21test: support testing notmuch as installedDavid Bremner
We put some effort into testing the built copy rather than some installed copy. On the other hand for people like packagers, testing the installed copy is also of interest. When NOTMUCH_TEST_INSTALLED is set to a nonempty value, tests do not require a built notmuch tree or running configure. Some of the tests marked as broken when running against installed notmuch are probably fixable.
2022-02-25test/emacs: split out tagging related testsDavid Bremner
T310-emacs is one of the largest and longest running sets of tests. Splitting out the tagging operations will help maintainability as well as potentially improve the parallel running time of the test suite. Some slowdown in running the tests sequentially may result since there is repeated setup.
2022-01-18CLI: print extra headers only for non-repliesDavid Bremner
If in the future we decide to output extra headers for replies, this should be controlled by a separate configuration option.
2022-01-18test/emacs: known broken test for reply with extra headers set.David Bremner
Although it makes sense for the extra headers to be added to the copy of the message headers included in the sexp/json, it is a bit surprising for them to show in the new message constructed for the reply, especially when, as here, they are always missing/empty.
2021-09-11emacs: wrap make-processDavid Bremner
Provide a safe working directory.
2021-09-11test/emacs: test for notmuch-search with nonexistent CWDDavid Bremner
(At least) notmuch-start-notmuch needs to be updated to set a safe working directory.
2021-09-08test/emacs: test for functions in notmuch-search-result-format.David Bremner
Based on the commit message in id:20210221151902.2301690-3-dme@dme.org Add the function notmuch-test-result-flags to test-lib.el to avoid repeating it in 3 T*.sh files.
2021-08-22CLI: define and use format version 5David Bremner
This is a bit of a cheat, since the format does not actually change. On the other hand it is fairly common to do something like this to shared libary SONAMEs when the ABI changes in some subtle way. It does rely on the format-version argument being early enough on the command line to generate a sensible error message.
2021-06-05emacs: update default mailing list archives for stashing linksJani Nikula
Gmane web interface is long gone, remove it. Make MARC the new default. Update LKML to Lore, where it already redirects anyway. Also add Notmuch web archive.
2021-06-03test: source $NOTMUCH_SRCDIR/test/test-lib-emacs.shTomi Ollila
Sourcing test-lib.sh will cd to TMP_DIRECTORY, so relative path in $0 will not work in previous version . $(dirname "$0")/test-lib-emacs.sh Now individual test scripts -- e.g. ./test/T310-emacs.sh will work.
2021-05-23test: ignore debugging messagesDavid Bremner
Previously building with "-DDEBUG" broke the test suite in several places.
2021-05-17test: split emacs functionality to its own fileFelipe Contreras
This way it's easier to identify the tests that do require emacs stuff. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-15Merge branch 'release'David Bremner
2021-05-15emacs: restore tag-changes and query bindings for tag hooksKyle Meyer
notmuch-before-tag-hook and notmuch-after-tag-hook are supposed to have access to two dynamic variables, tag-changes and query, but these were lost with the switch to lexical binding in fc4cda07 (emacs: use lexical-bindings in all libraries, 2021-01-13). Add a variant of Emacs's dlet (not available until Emacs 28) and use it in notmuch-tag to expose tag-changes and query to the hooks.
2021-05-15test: add known broken tests for notuch-{before,after}-tag-hookDavid Bremner
These tests illustrate the bug reported in id:87v97ytd2s.fsf@fastmail.fm
2021-05-01test: add external prereqs to many emacs testsFelipe Contreras
The tests fail otherwise. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2020-08-09emacs: Do not abuse advice to monkey patch while testingJonas Bernoulli
Use `cl-letf*' instead.
2019-05-20test/emacs: revert invalid-from test to pre-86f89385 behaviourDavid Bremner
To the best of my understanding, this original behaviour was what Carl's homebrew parser produced. With commit 86f89385 Austin switched to using GMime (2.6). This produced arguably worse results, but since the input was bad, we could live with it. Now with GMime 3.0 we are getting the original results again, and there is no reason to consider this test broken.
2019-05-03gmime-cleanup: tests should only care about gmime 3Daniel Kahn Gillmor
note that "notmuch-show for message with invalid From" is still broken in T310-emacs.sh. It would be good to debug what's going on there and try to get it fixed! signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2018-12-07reply: Include sender as recipient if they were the original recipientDavid Edmondson
When generating a reply message, if the user was the originator and only recipient of the original message, include the user as a recipient of the reply.
2018-09-28emacs: Call `notmuch-mua-send-hook' hooks when sending a messageDavid Edmondson
Previously any hook functions attached to `notmuch-mua-send-hook' were ignored.
2018-09-28test: Check that `notmuch-mua-send-hook' is called on sending a messageDavid Edmondson
2018-05-03move more http -> httpsDaniel Kahn Gillmor
Correct URLs that have crept into the notmuch codebase with http:// when https:// is possible. As part of this conversion, this changeset also indicates the current preferred upstream URLs for both gmime and sup. the new URLs are https-enabled, the old ones are not. This also fixes T310-emacs.sh, thanks to Bremner for catching it.
2017-10-20test: use source and build paths in T310-emacs.shJani Nikula
Make a distinction between source and build directories.
2017-10-20test: use $(dirname "$0") for sourcing test-lib.shJani Nikula
Don't assume the tests are always run from within the source tree.
2017-09-27emacs: sanitize subject in repliesJani Nikula
Commit a7964c86d125 ("emacs: Sanitize authors and subjects in search and show") added sanitization of header information for display. Do the same for reply subjects. This fixes the long-standing annoying artefact of certain versions of mailman using tab as folding whitespace, leading to tabs in reply subjects.
2017-09-27test: add emacs reply test for subjects with TABJani Nikula
Expect TABs to be sanitized from the subject line. Known broken.
2017-07-18emacs: convert remaining format-versions from 3 to 4David Bremner
This is needed for consistent beheviour between notmuch built against gmime-2.6 and gmime-3.0 w.r.t. error reporting.
2017-07-05test: mark test as broken in gmime 3.0David Bremner
Currently I'm not sure what the intent of this test is, so it's not clear if the new answer is better or worse than the old one.
2017-07-04emacs: convert to use format-version 3David Bremner
Keeping the emacs interface running old format-versions makes it impossible to test new format-versions or deprecate old ones.
2017-04-06test: standardize argument order to test_expect_equal_fileDavid Bremner
It is annoying to debug failing tests when the interpretation of the diffs is reversed for some tests.
2017-03-09test: require test_begin_subtest before test_expect_successJani Nikula
Unify the subtests by requiring test_begin_subtest before test_expect_success. (Similar change for test_expect_code will follow.) This increases clarity in the test scripts by having a separate line for the start of the subtest with the heading, and makes it possible to simplify the test infrastructure by making all subtests similar.
2017-03-04Test: emacs: test for folding long headers.Mark Walters
Headers of more than 998 characters should be folded when sending. However, until recently, emacs did not do this. This adds a (known broken) test for this when sending messages in emacs. We will backport the fix to notmuch-emacs in the next changeset.
2016-09-24test/emacs: add broken test for message replying to msg to selfDavid Bremner
This is a strange corner case where the removing of the user's address from the To: header does the wrong thing. If we think it is worth (eventually) fixing, this test can serve as a reminder.
2016-09-18emacs: reply: remove wrong sig/enc status buttonsMark Walters
This stops the (usually incorrect) sigstatus and encstatus buttons appearing when replying in emacs, and updates the test suite to match. Overriding the status button functions is a little unusual but much less intrusive than passing an argument all the way down the call chain. It also makes it clear exactly what it does. We also hide the application/pgp-encrypted part as it can only contain "Version: 1". We do this in notmuch show, which means it also happens when replying.
2016-08-11Omit User-Agent: header by defaultDaniel Kahn Gillmor
The User-Agent: header can be fun and interesting, but it also leaks quite a bit of information about the user and their software stack. This represents a potential security risk (attackers can target the particular stack) and also an anonymity risk (a user trying to preserve their anonymity by sending mail from a non-associated account might reveal quite a lot of information if their choice of mail user agent is exposed). This change also avoids hiding the User-Agent header by default, so that people who decide they want to send it will at least see it (and can edit it if they want to) before sending. It makes sense to have safer defaults.
2016-06-05Use https instead of http where possibleDaniel Kahn Gillmor
Many of the external links found in the notmuch source can be resolved using https instead of http. This changeset addresses as many as i could find, without touching the e-mail corpus or expected outputs found in tests.
2016-04-10emacs: Always insert crypto buttons.David Edmondson
When no decryption or signature examination is happening (i.e. `notmuch-crypto-process-mime' is `nil') insert buttons that indicate this, rather than remaining silent.
2016-03-14test: replace single giant term with large phraseDavid Bremner
We only need a long string, not a single long term to trigger batch mode. The giant term triggers a bug/incompatibility in Xapian 1.3.4 that throws an exception because it is longer than the Xapian term size limit.
2016-02-21emacs/mua: Generate improved cited text for repliesDavid Edmondson
Use the message display code to generate message text to cite in replies. For now we set insert-headers-p function to notmuch-show-reply-insert-header-p-never so that, as before, we don't insert part buttons. With that choice of insert-headers-p function there is only one failing test: this test has a text part (an email message) listed as application/octet-stream. Notmuch show displays this part, but the reply code omitted it as it had type application/octet-stream. The new code correctly includes it. Thus update the expected output to match.
2015-08-07test: make script exit (1) if it "fails" to source (.) a fileTomi Ollila
The files (test) scripts source (with builtin command `.`) provides information which the scripts depend, and without the `source` to succeed allowing script to continue may lead to dangerous situations (e.g. rm -rf "${undefined_variable}"/*). At the end of all source (.) lines construct ' || exit 1' was added; In our case the script script will exit if it cannot find (or read) the file to be sourced. Additionally script would also exits if the last command of the sourced file exited nonzero.
2014-10-25Merge tag '0.18.2_rc1'David Bremner
notmuch 0.18.2~rc1 release Conflicts: NEWS debian/changelog
2014-10-25test/emacs: force *Messages* buffer to be writableDavid Bremner
In emacs 24.4 the messages buffer starts being read-only, which kills these tests. This seems to be the point of the variable inihibit-read-only, which has existed at least since emacs 21.
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-03-25emacs: Use whitelist instead of blacklist for term escapingAustin Clements
Previously, the term escaper used a blacklist of characters that needed escaping. This blacklist turned out to be somewhat incomplete; for example, it did not contain non-whitespace ASCII control characters or Unicode "fancy quotes", both of which do require the term to be escaped. Switch to a whitelist of characters that are definitely safe to leave unquoted. This fixes the broken test introduced by the previous patch.
2014-03-25test: Add broken test for Emacs boolean term escapingAustin Clements
The current term escaper gets most of these right, but fails to escape things containing Unicode "fancy quotes" or things containing non-whitespace control characters.
2014-02-16emacs: update alist for mail-archive.com API changeJed Brown
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>
2014-01-13test: add test for syntax of emacs test libraryDavid Bremner
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.
2014-01-13test: renamed test scripts to format T\d\d\d-name.shTomi Ollila
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.