X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2Ftest-lib.sh;h=8611ba5ecefc6eddf62ae7da95d3fab39a421df8;hb=20adfe39d7624150a5b337bb77a9647bb3def54b;hp=ffab1bb509c400e15948b7fbe5df83d6294187d2;hpb=16aa65ba2575fd504c31d9671d8c5150f8e8adf1;p=notmuch diff --git a/test/test-lib.sh b/test/test-lib.sh index ffab1bb5..8611ba5e 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -22,6 +22,9 @@ if [ ${BASH_VERSINFO[0]} -lt 4 ]; then exit 1 fi +# Make sure echo builtin does not expand backslash-escape sequences by default. +shopt -u xpg_echo + # if --tee was passed, write the output not only to the terminal, but # additionally to the file test-results/$BASENAME.out, too. case "$GIT_TEST_TEE_STARTED, $* " in @@ -442,6 +445,7 @@ emacs_deliver_message () test_emacs \ "(let ((message-send-mail-function 'message-smtpmail-send-it) + (mail-host-address \"example.com\") (smtpmail-smtp-server \"localhost\") (smtpmail-smtp-service \"25025\")) (notmuch-hello) @@ -624,6 +628,17 @@ notmuch_json_show_sanitize () -e 's|"filename": "/[^"]*",|"filename": "YYYYY",|g' } +notmuch_emacs_error_sanitize () +{ + local command=$1 + shift + for file in "$@"; do + echo "=== $file ===" + cat "$file" + done | sed \ + -e 's/^\[.*\]$/[XXX]/' \ + -e "s|^\(command: \)\{0,1\}/.*/$command|\1YYY/$command|" +} # End of notmuch helper functions # Use test_set_prereq to tell that a particular prerequisite is available.