aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
Commit message (Collapse)AuthorAge
* test: use perl instead of sed -r for portabilityGravatar Jani Nikula2012-12-08
| | | | | Our OS X users report -r is not a supported option for sed. Use perl instead.
* test: wrap 'wc -l' results in arithmetic evaluation to strip whitespaceGravatar Jani Nikula2012-12-08
| | | | | This is for portability, as 'wc -l' emits whitespace on some BSD variants. Suggested by Tomi Ollila <tomi.ollila@iki.fi>.
* test: fix count testGravatar Jani Nikula2012-12-08
| | | | | | | The quoting for ${SEARCH} is broken when it's supposed to be '*', and it seems tricky to get it right. Just drop the variable and use '*' directly. Before this, none of the messages ever matched, and the test was comparing zeros.
* test: Fix UTF-8 JSON tests in Python 3Gravatar Austin Clements2012-12-08
| | | | | | | | | | | test_expect_equal_json uses json.tool from the system Python. While Python 2 wasn't picky about the encoding of stdin, Python 3 decodes stdin strictly according to the environment. Since we set LC_ALL=C for the tests, Python 3's json.tool was assuming stdin would be in ASCII and aborting when it couldn't decode the UTF-8 characters from some of the JSON tests. This patch sets the PYTHONIOENCODING environment variable to utf-8 when invoking json.tool to override Python's default encoding choice.
* Changing build tool for test/random-corpus to CXX instead of CC.Gravatar Peter Feigl2012-12-06
| | | | | | | | | | Without this change, GCC complains as follows: gcc test/random-corpus.o test/database-test.o notmuch-config.o command-line-arguments.o lib/libnotmuch.a util/libutil.a parse-time-string/libparse-time-string.a -o test/random-corpus -lgmime-2.6 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -Wl,-rpath,/usr/lib -ltalloc -lxapian /usr/bin/ld: lib/libnotmuch.a(database.o): undefined reference to symbol '_ZNSs4_Rep10_M_destroyERKSaIcE@@GLIBCXX_3.4' /usr/bin/ld: note: '_ZNSs4_Rep10_M_destroyERKSaIcE@@GLIBCXX_3.4' is defined in DSO /usr/lib/libstdc++.so.6 so try adding it to the linker command line /usr/lib/libstdc++.so.6: could not read symbols: Invalid operation collect2: error: ld returned 1 exit status make: *** [test/random-corpus] Error 1
* Adding parse-time to test/.gitignoreGravatar Peter Feigl2012-12-06
| | | | test/parse-time is a binary that is generated when running make test. It should be ignored by git.
* test: fix an evident copy-paste error in argument parsing testGravatar Jani Nikula2012-12-04
|
* test: add broken roundtrip testGravatar David Bremner2012-12-02
| | | | | | | | | | We demonstrate the current notmuch restore parser being confused by message-id's and tags containing non alpha numeric characters (particularly space and parentheses are problematic because they are not escaped by notmuch dump). We save the files as hex escaped on disk so that terminal emulators will not get confused if the test fails (as we mostly expect it to do).
* test: add generator for random "stub" messagesGravatar David Bremner2012-12-02
| | | | | | | | | | | | | | | | Initial use case is testing dump and restore, so we only have message-ids and tags. The message ID's are nothing like RFC compliant, but it doesn't seem any harder to roundtrip random UTF-8 strings than RFC-compliant ones. Tags are UTF-8, even though notmuch is in principle more generous than that. updated for id:m2wr04ocro.fsf@guru.guru-group.fi - talk about Unicode value rather some specific encoding - call talloc_realloc less times
* test: add database routines for testingGravatar David Bremner2012-12-02
| | | | | | | | Initially, provide a way to create "stub" messages in the notmuch database without corresponding files. This is essentially cut and paste from lib/database.cc. This is a seperate file since we don't want to export these symbols from libnotmuch or bloat the library with non-exported code.
* test/hex-escaping: new test for hex escaping routinesGravatar David Bremner2012-12-02
| | | | | | These are more like unit tests, to (try to) make sure the library functionality is working before building more complicated things on top of it.
* test/hex-xcode: new test binaryGravatar David Bremner2012-12-02
| | | | | | This program is used both as a test-bed/unit-tester for ../util/hex-escape.c, and also as a utility in future tests of dump and restore.
* test: Don't print 'nil' at the beginning of emacs-subject-to-filenameGravatar Austin Clements2012-11-29
|
* test: Use associative arrays to track external prereqsGravatar Austin Clements2012-11-29
| | | | | | | | | | | | | Previously, the test framework generated a variable name for each external prereq as a poor man's associative array. Unfortunately, prereqs names may not be legal variable names, leading to unintelligible bash errors like test_missing_external_prereq_emacsclient.emacs24_=t: command not found Using proper associative arrays to track prereqs, in addition to being much cleaner than generating variable names and using grep to carefully construct unique string lists, removes restrictions on prereq names.
* test: Abort driver if a test script abortsGravatar Austin Clements2012-11-29
| | | | | | | | | | | | | | | | | | Previously, if a test script aborted (e.g., because it passed too few arguments to a test function), the test driver loop would simply continue on to the next test script and the final results would declare that everything passed (except that the test count would look suspiciously low, but maybe you just misremembered how many tests there were). Now, if a test script exits with a non-zero status and did not produce a final results file, we propagate that failure out of the driver loop immediately. To keep this simple, this patch removes the PID from the test-results file name. This PID was inherited from the git test system and seems unnecessary, since the file name already includes the name of the test script and the test-results directory is created anew for each run.
* test: Make the emacsclient binary user-configurableGravatar Austin Clements2012-11-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | And require that if TEST_EMACS is specified, so is TEST_EMACSCLIENT. Previously, the test framework always used "emacsclient", even if the Emacs in use was overridden by TEST_EMACS. This causes problems if both Emacs 23 and Emacs 24 are installed, the Emacs 23 emacsclient is the system default, but TEST_EMACS is set to emacs24. Specifically, with an Emacs 24 server and an Emacs 23 client, emacs tests that run very quickly may produce no output from emacsclient, causing the test to fail. The Emacs server uses a very simple line-oriented protocol in which the client sends a request to evaluate an expression and the server sends a request to print the result of evaluation. Prior to Emacs bzr commit 107565 on March 11th, 2012 (released in Emacs 24.1), if multiple commands were sent to the emacsclient between when it sent the evaluation command and when it entered its receive loop, it would only process the first response command, ignoring the rest of the received buffer. This wasn't a problem with the Emacs 23 server because it sent only the command to print the evaluation result. However, the Emacs 24 server first sends an unprompted command specifying the PID of the Emacs server, then processes the evaluation request, then sends the command to print the result. If the evaluation is fast enough, it can send both of these commands before emacsclient enters the receive loop. Hence, if an Emacs 24 server is used with an Emacs 23 emacsclient, it may miss the response printing command, ultimately causing intermittent notmuch test failures.
* test: Quote $output in calls to test_expect_equalGravatar Austin Clements2012-11-27
| | | | | | | | Previously, many tests in emacs-subject-to-filename didn't quote the $output argument to test_expect_equal. As a result, if $output was empty, test_expect_equal would be passed only one argument and would abort the entire test script. By quoting the argument, we ensure test_expect_equal will always receive two arguments.
* new: Skip ignored broken symlinksGravatar Austin Clements2012-11-26
| | | | | | | | | We now test for user ignore patterns before attempting to determine if a directory entry is itself a directory. As a result, we no longer abort for broken symlinks if the user has explicitly ignored them. This fixes the test added in the previous patch. It also slightly changes the debug output checked by another test of ignores.
* test: Add a test for skipping ignored broken symlinksGravatar Austin Clements2012-11-26
| | | | | Currently marked as broken because we abort on broken symlinks, even if they are in the ignore list.
* emacs: less guessing of character set in messagesGravatar Tomi Ollila2012-11-26
| | | | | | | | | | | | | | | The macro with-current-notmuch-show-message executes command `notmuch show --format=raw id:...` which just outputs the contents of the mail file verbatim (into temporary buffer). In case e.g. utf-8 locale is used the temporary buffer has buffer-file-coding-system as utf-8. In this case Emacs converts the data to multibyte format, guessing that input is in utf-8. However, the "raw" (MIME) message may contain octet data in any other 8bit format, and as no (MIME-)content spesific handling to the message is done at this point, conversion to other formats may lose information. By setting coding-system-for-read 'no-conversion drops the conversion part and makes this handle input as notmuch-get-bodypart-internal() does. This marks the broken test in previous change fixed.
* test/emacs: test saving of attachment containing 8bit octetsGravatar Tomi Ollila2012-11-26
| | | | | | This test catches the case 8bit octets in an attachment gets converted or lost when saving attachment to the file. This test is marked known broken.
* lib: Reject multi-message mboxes and deprecate single-message mboxGravatar Austin Clements2012-11-26
| | | | | | | | Previously, we would treat multi-message mboxes as one giant email, which, besides the obvious incorrect indexing, often led to out-of-memory errors for archival mboxes. Now we explicitly reject multi-message mboxes. For historical reasons, we retain support for single-message mboxes, but official deprecate this behavior.
* test: Test for ignoring multi-message mboxGravatar Austin Clements2012-11-26
| | | | | | This test is currently broken. Note that its brokenness cascades and causes the next test to fail as well (because notmuch incorrectly indexes the mbox file).
* test: Test notmuch new for single-message mboxGravatar Austin Clements2012-11-26
| | | | We support this for historical reasons.
* test: factor out part of test-lib.sh into test-lib-common.shGravatar David Bremner2012-11-25
| | | | | The idea is to use some of the simpler parts of the test suite infrastructure to help run performance tests.
* test: always source test-lib.sh as ./test-lib.shGravatar Tomi Ollila2012-11-24
| | | | | | | | | | | There are currently 45 TESTS scripts. 36 of those load test-lib.sh using '. ./test-lib.sh' and 9 '. test-lib.sh'. In latter case test-lib.sh is first searched from directories in PATH (posix) and then from current directory (bash feature). Changed the 9 files to execute '. ./test-lib.sh'. The test-lib.sh should never be loaded from directory in PATH.
* test: Produce useful output when the HTML with images test failsGravatar Austin Clements2012-11-21
| | | | | | | Previously, this would simply indicate that the grep failed without any indication of the Emacs output it failed on. Now we take advantage of the test framework's handling of stdout to display the incorrect Emacs output if the test fails.
* test: add nontrivial test for restore --accumulate.Gravatar David Bremner2012-11-17
| | | | | | | | | | It seems we have never tested the case that restore --accumulate actually adds tags. I noticed this when I started optimizing and no tests failed. The bracketing with "restore --input=dump.expected" are to make sure we start in a known state, and we leave the database in a known state for the next test.
* test: add more informative titles to restore --accumulate testsGravatar David Bremner2012-11-17
| | | | Thanks to Ethan for the suggestion.
* Fixed 2 misspellings of word 'separate'Gravatar Tomi Ollila2012-11-16
| | | | | | | "Seperate: The second most common misspelling on the Internet..." (from http://www.re-vision.com/spelling/separate.html). s/seperate/separate/ in debian/NEWS.Debian & test/README done.
* test: Fix HTML rendering testGravatar Austin Clements2012-11-15
| | | | | | | | | The test designed to exercise Emacs' rendering of HTML emails containing images inadvertently assumed w3m was available under Emacs 23. The real point of this test was to check that Emacs 24's shr renderer didn't crash when given img tags, so use shr if it's available, html2text otherwise (which is built in), and do only a simple sanity check of the result.
* emacs: Buttonize mid: linksGravatar Austin Clements2012-11-15
| | | | This adds support for RFC 2392 mid: message ID links.
* emacs: Improve the regexp used to match id:'s in messagesGravatar Austin Clements2012-11-15
| | | | | | | | | | | | | | | This regexp agrees with Xapian query syntax much more closely, though we specifically disallow various cases that would be confusing in the context of an email body (e.g., punctuation at the end of an id: link is not considered part of the id: link because it's probably part of the surrounding text). In particular, this handles id: links that are not surrounded by quotes much better, which stash is much more likely to generate now that we don't quote id's that don't need to be quoted. It also handles quoted id: links better. We update the buttonization test to reflect the new pattern.
* test: Test buttonization of id: linksGravatar Austin Clements2012-11-15
| | | | | | | 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.
* test: expand regex in test/basicGravatar David Bremner2012-11-10
| | | | | | | | | Over time, maintaining this very long regex has become irritating, especially when resolving conflicts. This patch replaces the call to sed with multiple extra arguments to find. Since each test binary is now on it's own line, this should make resolving conflicts easier.
* test: add test for showing Reply-To headersGravatar Peter Wang2012-11-07
| | | | | Test that show --format=json now outputs Reply-To header fields when present.
* test: add tests for date:since..until range queriesGravatar Jani Nikula2012-10-31
| | | | A brief initial test set.
* test: add smoke tests for the date/time parser moduleGravatar Jani Nikula2012-10-31
| | | | | | | | Test the date/time parser module directly, independent of notmuch, using the parse-time test tool. Credits to Michal Sojka <sojkam1@fel.cvut.cz> for writing most of the tests.
* test: add new test tool parse-time for date/time parserGravatar Jani Nikula2012-10-31
| | | | | | | | Add a smoke testing tool to support testing the date/time parser module directly and independent of the rest of notmuch. Credits to Michal Sojka <sojkam1@fel.cvut.cz> for the stdin parsing idea and consequent massive improvement in testability.
* emacs: Introduce generic boolean term escaping functionGravatar Austin Clements2012-10-27
| | | | | | | Currently, we only properly escape stashed id queries, but there are other places where the Emacs UI constructs queries for boolean terms. Since this escaping function is meant to be used in other places, it avoids escaping strings that don't need escaping.
* tag: Disallow adding malformed tags to messagesGravatar Austin Clements2012-10-27
| | | | | | | | | | | | This disallows adding empty tags, since nothing but confusion follows in their wake, and disallows adding tags that begin with "-" because they are also confusing, the tag "-" is impossible to remove using the CLI, and because the syntax for removing such tags conflicts with long argument syntax. This does not place any restrictions on what tags can be removed, as that would make it difficult for people who have the misfortune of already having malformed tags to remove these tags.
* notmuch-show: include Bcc header in json outputGravatar Michal Nazarewicz2012-10-22
| | | | | With this change, emacs users can use notmuch-message-headers variable to configure notmuch-show display Bcc header.
* test: new: Fix intermittent test failures with --debugGravatar Ethan Glasser-Camp2012-10-22
| | | | | | | | | | | | | Although messages are created in a particular order, it seems that when they are created on a tmpfs, they do not always come back in the same order, leading to the same files being ignored but being output in a different order. This causes the test to fail because the outputs being compared are the same. Fix the failures by sorting the output of notmuch --debug and comparing this to a hand-sorted version of its output. Signed-off-by: Ethan Glasser-Camp <ethan@betacantrips.com>
* test/test-lib.sh: take the --background feature in smtp-dummy into useGravatar Tomi Ollila2012-10-20
| | | | | | | | | | | | | | The use of --background option (instead of shell '&') ensures that smtp-dummy is listening its server socket until execution of shell script can continue, thus the client will always have socket where to connect. smtp-dummy outputs smtp_dummy_pid variable in shell assignment format; eval'ing that output makes that variable available for the shell. As the smtp-dummy instance is no longer child process of the script the SIGKILL signal sent to it will ensure it is going away in case the mail sender fails to connect to smtp-dummy.
* test/smtp-dummy: add --background option and functionalityGravatar Tomi Ollila2012-10-20
| | | | | | | | | | | | When shell executes background process using '&' the scheduling of that new process is arbitrary. It could be that smtp-dummy doesn't get execution time to listen() it's server socket until some other process attempts to connect() to it. The --background option in smtp-dummy makes it to go background *after* it started to listen its server socket. When --background option is used, the line "smtp_dummy_pid='<pid>'" is printed to stdout from where shell can eval it.
* test: another test wrt ignoring user-specified files and directoriesGravatar Pieter Praet2012-10-20
| | | | | | | | Demonstrates that *every* file/directory which matches one of the values in 'new.ignore' will be ignored, independent of its depth/location in the mail store. Signed-off-by: Ethan Glasser-Camp <ethan@betacantrips.com>
* test-lib.sh: pass 'NOTMUCH_NEW's args down to 'notmuch new'Gravatar Pieter Praet2012-10-20
| | | | | | | Obviates the need to create a 'NOTMUCH_NEW' clone which runs 'notmuch new --debug'. This will be used in a later patch. Doesn't cause any issues for other tests.
* emacs: rename `notmuch-show-toggle-headers' to ↵Gravatar Pieter Praet2012-10-20
| | | | | | | | | | | | | | | | | | | | | | | | `notmuch-show-toggle-visibility-headers' * emacs/notmuch-show.el (notmuch-show-toggle-headers): Rename to `notmuch-show-toggle-visibility-headers'. (notmuch-show-mode-map): Update "h" binding wrt renamed `notmuch-show-toggle-headers'. (notmuch-message-headers): Update docstring wrt renamed `notmuch-show-toggle-headers'. (notmuch-message-headers-visible): Update docstring wrt renamed `notmuch-show-toggle-headers'. Also fixed a small typo. * test/emacs: Update subtest wrt renamed `notmuch-show-toggle-headers': - "notmuch-show: hide message headers (w/ notmuch-show-toggle-headers)"
* test: emacs: new tests "notmuch-show: {, un}collapse all messages in thread"Gravatar Pieter Praet2012-10-20
| | | | | | | | | | | | * test/emacs: - New subtest "notmuch-show: collapse all messages in thread": `notmuch-show-open-or-close-all' with prefix arg ("C-u M-RET") collapses all messages in thread. - New subtest "notmuch-show: uncollapse all messages in thread": `notmuch-show-open-or-close-all' without prefix arg ("M-RET") uncollapses all messages in thread.
* test: emacs: new tests "notmuch-show: {show, hide} message headers"Gravatar Pieter Praet2012-10-20
| | | | | | | | | | | | | | | | | | | * test/emacs: - New subtest "notmuch-show: show message headers": Setting `notmuch-message-headers-visible' to t causes all headers defined in `notmuch-message-headers' to be shown. - New subtest "notmuch-show: hide message headers": Setting `notmuch-message-headers-visible' to nil causes all headers defined in `notmuch-message-headers' to be hidden. ("Subject:" may be an exception; See the use of `headers-start' in `notmuch-show-insert-msg') - New subtest "notmuch-show: hide message headers (w/ notmuch-show-toggle-headers)": Setting `notmuch-message-headers-visible' to t causes all headers defined in `notmuch-message-headers' to be shown, but they can be hidden for the current message by running `notmuch-show-toggle-headers'.