aboutsummaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAge
* Rename the -json printer functions in notmuch-reply and notmuch-show to ↵Gravatar Peter Feigl2012-12-08
| | | | | | | | | generic -sprinter functions. All the structured output functions in notmuch-reply and notmuch-show are renamed to a generic name (as they do not contain any json-specific code anyway). This patch is a preparation to actually using the new S-Expression sprinter in notmuch-reply and notmuch-show.
* Adding an S-expression structured output printer.Gravatar Peter Feigl2012-12-08
| | | | | | | | | | | | | | | This commit adds a structured output printer for Lisp S-Expressions. Later commits will use this printer in notmuch search, show and reply. The structure is the same as json, but: - arrays are written as lists: ("foo" "bar" "baaz" 1 2 3) - maps are written as p-lists: (:key "value" :other-key "other-value") - true is written as t - false is written as nil - null is written as nil [ whitespace changes by db ]
* 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.
* NEWS: removal of notmuch-foldersGravatar Jani Nikula2012-12-06
|
* emacs: show: refresh buffer did not remove overlaysGravatar Mark Walters2012-12-06
| | | | | | | | | Previously refreshing the notmuch show buffer did not remove overlays which meant that if the user refreshed a message with images the images would remain and then the new text was added after. One might have guessed that erase-buffer would have removed them but it seems not. Thus force the removal of overlays with remove-overlays.
* emacs: stash bugfixGravatar Mark Walters2012-12-06
| | | | | | Currently an attempt to stash a non-existent field (eg cc when not present) throws an error. Catch this case and give the user a warning message.
* cli: convert "notmuch new" to the argument parserGravatar Jani Nikula2012-12-04
| | | | | | Use the notmuch argument parser to handle arguments in "notmuch new". As a side effect, this fixes broken STRNCMP_LITERAL usage that accepts, for example, --verbosefoo for --verbose.
* cli: fix notmuch top level argument parsingGravatar Jani Nikula2012-12-04
| | | | | Use strcmp instead of STRNCMP_LITERAL, which matches the prefix instead of the whole argument.
* emacs: drop support for deprecated notmuch-foldersGravatar Jani Nikula2012-12-04
| | | | | | | | | | | | Remove notmuch-folders which has been deprecated since commit a4669217600e4536dc0c49f0255af5e2d9bc183f Author: Carl Worth <cworth@cworth.org> Date: Mon Apr 26 22:42:07 2010 -0700 emacs: Rip out all of the notmuch-folder code. This lets us simplify the notmuch-saved-searches code slightly.
* test: fix an evident copy-paste error in argument parsing testGravatar Jani Nikula2012-12-04
|
* contrib: pick: use notmuch-clean-addressGravatar Mark Walters2012-12-03
| | | | | Now notmuch-clean-address is split out in show pick can use that (with a small wrapper).
* 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.
* hex-escape: (en|de)code strings to/from restricted character setGravatar David Bremner2012-12-02
| | | | | | | The character set is chosen to be suitable for pathnames, and the same as that used by contrib/nmbug [With additions by Jani Nikula]
* contrib: pick: use async parser from libGravatar Mark Walters2012-12-01
| | | | | This moves notmuch-pick to use the newly split out async json parser from notmuch-lib.el.
* contrib: pick: remove some debug timing messagesGravatar markwalters10092012-12-01
| | | | | When I submitted notmuch-pick I deleted most of the debug messages but I missed two cases. Remove them now.
* emacs: Split the function notmuch-show-clean-addressGravatar Mark Walters2012-12-01
| | | | | | | | This function is also used by pick so split it out in preperation for moving to lib. In fact, pick and show want a slightly different combination of name and email on return so make the separated function return them as a pair, and let show or pick extract the combination they want from that.
* lib: fix warnings when building with clangGravatar Jani Nikula2012-12-01
| | | | | | | | | | | | | | | | | | | | | | | | | | Building notmuch with CC=clang and CXX=clang++ produces the warnings: CC -O2 lib/tags.o lib/tags.c:43:5: warning: expression result unused [-Wunused-value] talloc_steal (tags, list); ^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/talloc.h:345:143: note: expanded from: ...__location__); __talloc_steal_ret; }) ^~~~~~~~~~~~~~~~~~ 1 warning generated. CXX -O2 lib/message.o lib/message.cc:791:5: warning: expression result unused [-Wunused-value] talloc_reference (message, message->tag_list); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/talloc.h:932:36: note: expanded from: ...(_TALLOC_TYPEOF(ptr))_talloc_reference_loc((ctx),(ptr), __location__) ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. Check talloc_reference() return value, and explicitly ignore talloc_steal() return value as it has no failure modes, to silence the warnings.
* news: add news entry for notmuch-pickGravatar markwalters10092012-12-01
|
* configure: really expand libdir_expandedGravatar David Bremner2012-12-01
| | | | | | | | | It turns out that if people really use configure in autotools style and pass libdir containing '${prefix}/foo' then the ldconfig previously failed. This uses sed for portability (versus bash parameter expansion with substitution) and hopefully a bit more robustness than blindly parameter expanding the string.
* performance-test: add units to In and OutGravatar David Bremner2012-11-29
| | | | | Austin Read enough Fine Manuals to figure out this is in multiples of 512 bytes.
* performance-test/README: update instructions for fetching corpus.Gravatar David Bremner2012-11-29
| | | | It turns out not everybody on the planet has my gpg key.
* 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: initial performance testing infrastructureGravatar David Bremner2012-11-26
| | | | | | | | This is not near as fancy as as the unit tests, on the theory that the code should typically be crashing when performance tuning. Nonetheless, there is plenty of room for improvement. Several more of the pieces of the test infrastructure (e.g. the option parsing) could be factored out into test/test-lib-common.sh
* 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.
* notmuch-show.el: handle the case where icalendar-import-buffer returns nilGravatar Tomi Ollila2012-11-25
| | | | | | | | | | | icalendar-import-buffer can fail by an error signal (which have been witnessed) but according to its docstring it can also return nil when failing (it returns t when succeeding). Now that the error is caught by the caller of notmuch-show-inset-part-* functions in case icalendar-import-buffer returns nil an explicit error is signaled and unwind-protect takes care of deleting the temporary file (just in case, it is usually not written to the fs yet).
* notmuch-show.el: import calendar data with public function after CR removalGravatar Tomi Ollila2012-11-25
| | | | | | | | | | | notmuch-get-bodypart-content provides raw data to its caller so that it can be stored verbatim whenever needed. icalendar functions expect Emacs to do EOL conversion for the data given to these. Therefore it the CRLF -> LF conversion is now done explicitly. The calls to private functions icalendar--convert-ical-to-diary and icalendar--read-element are replaced with call to public function icalendar-import-buffer.
* 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.
* contrib: notmuch-pick: add testsGravatar Mark Walters2012-11-19
| | | | | | The test should be run using the wrapper run-tests.sh. This links the tests into the normal notmuch TEST_DIRECTORY and runs them from there. After the test is complete then the links are removed.
* 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.