X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2Femacs;h=5bc3efcc6a87dc65b19031d489a804cc52b5fa2e;hb=2593df527168ad3502f0d44f4feae76133fc271b;hp=3b26d32f60462e6a43af31dc4fd263e87837c990;hpb=1546387d723ec47cd281f3c2bf6da2fddf18c045;p=notmuch diff --git a/test/emacs b/test/emacs index 3b26d32f..5bc3efcc 100755 --- a/test/emacs +++ b/test/emacs @@ -855,11 +855,10 @@ test_expect_success "Rendering HTML mail with images" \ 'cat OUTPUT && grep -q smiley OUTPUT' -test_begin_subtest "Search handles subprocess errors" +test_begin_subtest "Search handles subprocess error exit codes" cat > notmuch_fail <&2 +echo '()' exit 1 EOF chmod a+x notmuch_fail @@ -874,17 +873,42 @@ test_emacs "(let ((notmuch-command \"$PWD/notmuch_fail\")) (test-output))" sed -i -e 's/^\[.*\]$/[XXX]/' ERROR test_expect_equal "$(cat OUTPUT; echo ---; cat MESSAGES; echo ---; cat ERROR)" "\ -Error: Unexpected output from notmuch search: -This is output -Error: Unexpected output from notmuch search: -This is an error End of search results. --- $PWD/notmuch_fail exited with status 1 (see *Notmuch errors* for more details) --- [XXX] $PWD/notmuch_fail exited with status 1 -command: $PWD/notmuch_fail search --format\=json --format-version\=1 --sort\=newest-first tag\:inbox +command: $PWD/notmuch_fail search --format\=sexp --format-version\=1 --sort\=newest-first tag\:inbox exit status: 1" +test_begin_subtest "Search handles subprocess warnings" +cat > notmuch_fail <&2 +echo This is another warning >&2 +exit 0 +EOF +chmod a+x notmuch_fail +test_emacs "(let ((notmuch-command \"$PWD/notmuch_fail\")) + (with-current-buffer \"*Messages*\" (erase-buffer)) + (with-current-buffer \"*Notmuch errors*\" (erase-buffer)) + (notmuch-search \"tag:inbox\") + (notmuch-test-wait) + (with-current-buffer \"*Messages*\" + (test-output \"MESSAGES\")) + (with-current-buffer \"*Notmuch errors*\" + (test-output \"ERROR\")) + (test-output))" +sed -i -e 's/^\[.*\]$/[XXX]/' ERROR +test_expect_equal "$(cat OUTPUT; echo ---; cat MESSAGES; echo ---; cat ERROR)" "\ +End of search results. +--- +This is a warning (see *Notmuch errors* for more details) +--- +[XXX] +This is a warning +This is another warning" + test_done