unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Mark Walters <markwalters1009@gmail.com>
To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org
Subject: Re: [PATCH 7/7] test: Test search's handling of subprocess errors
Date: Sat, 15 Dec 2012 09:48:24 +0000	[thread overview]
Message-ID: <87zk1ffxxz.fsf@qmul.ac.uk> (raw)
In-Reply-To: <1355548513-10085-8-git-send-email-amdragon@mit.edu>

On Sat, 15 Dec 2012, Austin Clements <amdragon@MIT.EDU> wrote:
> ---
>  test/emacs |   23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
>
> diff --git a/test/emacs b/test/emacs
> index 5403930..88b062c 100755
> --- a/test/emacs
> +++ b/test/emacs
> @@ -853,4 +853,27 @@ test_expect_success "Rendering HTML mail with images" \
>      'cat OUTPUT && grep -q smiley OUTPUT'
>  
>  
> +test_begin_subtest "Search handles subprocess errors"
> +cat > notmuch_fail <<EOF
> +#!/bin/sh
> +echo This is output
> +echo This is an error >&2
> +exit 1
> +EOF
> +chmod a+x notmuch_fail
> +test_emacs "(let ((notmuch-command \"$PWD/notmuch_fail\"))
> +	       (notmuch-search \"tag:inbox\")
> +	       (notmuch-test-wait)
> +	       (test-output)
> +	       (with-current-buffer \"*Notmuch errors*\"
> +		  (test-output \"ERROR\")))"
> +test_expect_equal "$(cat OUTPUT ERROR)" "\
> +Error: Unexpected output from notmuch search:
> +This is output
> +Error: Unexpected output from notmuch search:
> +This is an error
> +End of search results.
> +Error invoking notmuch.  /tmp/nmtest/tmp.emacs/notmuch_fail search --format=json --sort=newest-first tag:inbox exited with status 1."

The filename above is hardcoded so fails for me, and the same for patch
5/7 (modulo this the tests would both pass)

Best wishes 

Mark


 

> +
> +
>  test_done
> -- 
> 1.7.10.4

      reply	other threads:[~2012-12-15  9:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-15  5:15 [PATCH 0/7] Improve Emacs CLI error handling Austin Clements
2012-12-15  5:15 ` [PATCH 1/7] emacs: Centralize notmuch command " Austin Clements
2012-12-15 16:20   ` Tomi Ollila
2012-12-15 19:45     ` Austin Clements
2012-12-15  5:15 ` [PATCH 2/7] emacs: Use unified error handling in notmuch-call-notmuch-process Austin Clements
2012-12-15  9:30   ` Mark Walters
2012-12-15 19:51     ` Austin Clements
2012-12-15  5:15 ` [PATCH 3/7] emacs: Factor out synchronous notmuch JSON invocations Austin Clements
2012-12-15  5:15 ` [PATCH 4/7] emacs: Improve error handling for notmuch-call-notmuch-json Austin Clements
2012-12-15  5:15 ` [PATCH 5/7] test: Test show's handling of subprocess errors Austin Clements
2012-12-15  5:15 ` [PATCH 6/7] emacs: Use unified error handling in search Austin Clements
2012-12-15  9:33   ` Mark Walters
2012-12-15 19:52     ` Austin Clements
2012-12-15  5:15 ` [PATCH 7/7] test: Test search's handling of subprocess errors Austin Clements
2012-12-15  9:48   ` Mark Walters [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zk1ffxxz.fsf@qmul.ac.uk \
    --to=markwalters1009@gmail.com \
    --cc=amdragon@MIT.EDU \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).