X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2Femacs;h=5bc3efcc6a87dc65b19031d489a804cc52b5fa2e;hb=2593df527168ad3502f0d44f4feae76133fc271b;hp=5067d67b5ad42fa75b3d03e105688d4e69a9347a;hpb=1e12b91b3cf823d21f7edf8c0f1c687df56fec14;p=notmuch diff --git a/test/emacs b/test/emacs index 5067d67b..5bc3efcc 100755 --- a/test/emacs +++ b/test/emacs @@ -525,7 +525,9 @@ test_expect_equal_file attachment1.gz "$EXPECTED/attachment" test_begin_subtest "Save attachment from within emacs using notmuch-show-save-part" # save as archive to test that Emacs does not re-compress .gz test_emacs '(let ((standard-input "\"attachment2.gz\"")) - (notmuch-show-save-part "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com" 5))' + (notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com") + (search-forward "0001-Deal-with") + (notmuch-show-save-part))' test_expect_equal_file attachment2.gz "$EXPECTED/attachment" test_begin_subtest "Save 8bit attachment from within emacs using notmuch-show-save-attachments" @@ -853,27 +855,60 @@ 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 test_emacs "(let ((notmuch-command \"$PWD/notmuch_fail\")) + (with-current-buffer \"*Messages*\" (erase-buffer)) (notmuch-search \"tag:inbox\") (notmuch-test-wait) - (test-output) + (with-current-buffer \"*Messages*\" + (test-output \"MESSAGES\")) (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 + (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. -Error invoking notmuch. $PWD/notmuch_fail search --format=json --sort=newest-first tag:inbox exited with status 1." - +--- +$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\=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