aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
Commit message (Collapse)AuthorAge
* cli: config: make notmuch_config_open() "is new" parameter input onlyGravatar Jani Nikula2013-03-07
| | | | | | | | We now have a notmuch_config_is_new() function to query whether a config was created or not. Change the notmuch_config_open() is_new parameter into boolean create_new to determine whether the function should create a new config if one doesn't exist. This reduces the complexity of the API.
* test/README: mention the test_expect_equal_json and *sanitize* functionsGravatar Aaron Ecay2013-03-07
| | | | also fix one typo
* Merge branch 'release'Gravatar David Bremner2013-02-18
|\ | | | | | | | | | | | | add in NEWS from 0.15.2 Conflicts: NEWS
* | test/test-lib.sh: separate signaled exitGravatar Tomi Ollila2013-02-18
| | | | | | | | | | | | | | When execution of tests is interrupted by signal coming outside of the test system itself, output just one line "interrupted by signal <num>" message to standard output. This distinguishes the case from internal exit and reduces noise.
* | test/test-lib.sh: use $test_subtest_name in all testsGravatar Tomi Ollila2013-02-18
| | | | | | | | | | | | | | | | | | Set the variable '$test_subtest_name' in all functions which starts a new test and use that variable in all functions that output test results. Additionally output the latest '$test_subtest_name' in case of abnormal exit, to avoid confusion.
| * test: delay watchdog checks in emacs.Gravatar David Bremner2013-01-29
|/ | | | | | | | | 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.
* test/test-lib.sh: use vt100 as dtach terminal if TERM dumb or unset/emptyGravatar Tomi Ollila2013-01-24
| | | | | | | | | | | | The TERM environment variable is set to 'dumb' when running tests, but the original value of it is stored for echoing colors and running emacs (somewhat interactively) in detached session. Emacs requires some terminal control sequences to be available for interactive operation. In case original TERM is (also) 'dumb' (or unset/empty) emacs cannot run interactively. To fix this problem dtach (and emacs as it's child process) is run with TERM=vt100 in case original TERM was unset, empty or 'dumb'. This way there is a chance to run emacs tests with different user terminals and potentially find problems there.
* test/tagging: add test for naked punctuation in tags; compare with quoting ↵Gravatar David Bremner2013-01-07
| | | | | | | | | spaces. This test also serves as documentation of the quoting requirements. The comment lines are so that it exactly matches the man page. Nothing more embarrassing than having an example in the man page fail.
* test/tagging: add test for exotic message-ids and batch taggingGravatar David Bremner2013-01-07
| | | | | | The (now fixed) bug that this test revealed is that unquoted message-ids with whitespace or other control characters in them are split into several tokens by the Xapian query parser.
* test/tagging: add tests for exotic tagsGravatar David Bremner2013-01-07
| | | | We test quotes seperately because they matter to the query escaper.
* test/tagging: add basic tests for batch tagging functionalityGravatar David Bremner2013-01-07
| | | | | This tests argument parsing, blank lines and comments, and basic hex decoding functionality.
* test/tagging: add test for error messages of tag --batchGravatar David Bremner2013-01-07
| | | | | | This is based on the similar test for notmuch restore, but the parser in batch tagging mode is less tolerant of a few cases, in particular those tested by illegal_tag.
* emacs: Use the minibuffer for CLI error reportingGravatar Austin Clements2013-01-06
| | | | | | | | | | | | | | | | We recently switched to popping up a buffer to report CLI errors, but this was too intrusive, especially for transient errors and especially since we made fewer things ignore errors. This patch changes this to display a basic error message in the minibuffer (using Emacs' usual error handling path) and, if there are additional details, to log these to a separate error buffer and reference the error buffer from the minibuffer message. This is more in line with how Emacs typically handles errors, but makes the details available to the user without flooding them with the details. Given this split, we pare down the basic message and make it more user-friendly, and also make the verbose message even more detailed (and more debugging-oriented).
* dump/restore: Use Xapian queries for batch-tag formatGravatar Austin Clements2013-01-06
| | | | | | | | | | | | | | This switches the new batch-tag format away from using a home-grown hex-encoding scheme for message IDs in the dump to simply using Xapian queries with Xapian quoting syntax. This has a variety of advantages beyond presenting a cleaner and more consistent interface. Foremost is that it will dramatically simplify the quoting for batch tagging, which shares the same input format. While the hex-encoding is no better or worse for the simple ID queries used by dump/restore, it becomes onerous for general-purpose queries used in batch tagging. It also better handles strange cases like "id:foo and bar", since this is no longer syntactically valid.
* dump: Disallow \n in message IDsGravatar Austin Clements2013-01-06
| | | | | | | | | | | | | | | When we switch to using regular Xapian queries in the dump format, \n will cause problems, so we disallow it. Specially, while Xapian can quote and parse queries containing \n without difficultly, quoted queries containing \n still span multiple lines, which breaks the line-orientedness of the dump format. Strictly speaking, we could still round-trip these, but it would significantly complicate restore as well as scripts that deal with tag dumps. This complexity would come at absolutely no benefit: because of the RFC 2822 unfolding rules, no amount of standards negligence can produce a message with a message ID containing a line break (not even Outlook can do it!). Hence, we simply disallow it.
* notmuch-restore: handle empty input file, leading blank lines and comments.Gravatar David Bremner2013-01-06
| | | | | | | | | | This patch corrects several undesirable behaviours: 1) Empty files were not detected, leading to buffer read overrun. 2) An initial blank line cause restore to silently abort 3) Initial comment line caused format detection to fail
* test/dump-restore: new tests for empty files and leading comments/whitespace.Gravatar David Bremner2013-01-06
| | | | | Three of these are marked broken; the third is a regression test, since it passes by virtue of batch-tag being the default input format.
* test: notmuch search --format=text0Gravatar Jani Nikula2012-12-18
|
* test: conform to content length, encoding fieldsGravatar Peter Wang2012-12-17
| | | | | | Update tests to expect content-length and content-transfer-encoding fields in show --format=json output, for leaf parts with omitted body content.
* test: normalize only message filenames in show jsonGravatar Peter Wang2012-12-17
| | | | | | | notmuch_json_show_sanitize replaced "filename" field values even in part structures, where the value is predictable. Make it only normalize the filename value if it is an absolute path (begins with slash), which is true of the Maildir filenames that were intended to be normalized away.
* emacs: Use --format-version for search, show, and replyGravatar Austin Clements2012-12-16
|
* test: Sanity tests for the --format-version argumentGravatar Austin Clements2012-12-16
|
* test: Test search's handling of subprocess errorsGravatar Austin Clements2012-12-16
|
* emacs: Use unified error handling in searchGravatar Austin Clements2012-12-16
| | | | | | This slightly changes the output of an existing test since we now report non-zero exits with a pop-up buffer instead of at the end of the search results.
* test: Test show's handling of subprocess errorsGravatar Austin Clements2012-12-16
|
* test: emacs: new tests "notmuch-show: {add,remove} multiple tags {to,from} ↵Gravatar Pieter Praet2012-12-11
| | | | | | | | | | | | | | | | single message" * test/emacs: - Rename subtests "{Add,Remove} tag from notmuch-show view" to "notmuch-show: {add,remove} single tag {to,from} single message" to be consistent with the following tests. - New subtest "notmuch-show: add multiple tags to single message": `notmuch-show-add-tag' ("+") can add multiple tags to a message. - New subtest "notmuch-show: remove multiple tags from single message": `notmuch-show-remove-tag' ("-") can remove multiple tags from a message.
* test/dump-restore: add test for warning/error messagesGravatar David Bremner2012-12-09
| | | | | | We want to test both that error/warning messages are generated when they should be, and not generated when they should not be. This varies between restore and batch tagging.
* test: second set of dump/restore --format=batch-tag testsGravatar David Bremner2012-12-09
| | | | | | | | These one need the completed functionality in notmuch-restore. Fairly exotic tags are tested, but no weird message id's. We test each possible input to autodetection, both explicit (with --format=auto) and implicit (without --format).
* test: update dump-restore roundtripping test for batch-tag formatGravatar David Bremner2012-12-09
| | | | | Now we can actually round trip these crazy tags and and message ids. hex-xcode is no longer needed as it's built in.
* test: add sanity check for dump --format=batch-tag.Gravatar David Bremner2012-12-08
| | | | | It's important this does not rely on restore, since it hasn't been written yet.
* Adding tests for --format=sexp.Gravatar Peter Feigl2012-12-08
| | | | | Add basic tests, the same as for json, for the S-Expression output format.
* 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.