[PATCH 7/7] test: Test search's handling of subprocess errors

Mark Walters markwalters1009 at gmail.com
Sat Dec 15 01:48:24 PST 2012


On Sat, 15 Dec 2012, Austin Clements <amdragon at 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


More information about the notmuch mailing list