X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2Ftest-lib.sh;h=62e123d65aba8deae1f6e461ac8c4442562f608a;hp=0bf7163e9f34863c9671689cdca98dcca0cfd85b;hb=b183f2635eaf323066f26c7ca22d931d4f4ccd3a;hpb=02a2eeb427d6b424029f6e5e5ddad4c6ec987741 diff --git a/test/test-lib.sh b/test/test-lib.sh index 0bf7163e..62e123d6 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -1,5 +1,6 @@ # # Copyright (c) 2005 Junio C Hamano +# Copyright (c) 2010 Notmuch Developers # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -82,6 +83,9 @@ unset CDPATH unset GREP_OPTIONS +# For emacsclient +unset ALTERNATE_EDITOR + # Convenience # # A regexp to match 5 and 40 hexdigits @@ -675,9 +679,14 @@ notmuch_search_sanitize () perl -pe 's/("?thread"?: ?)("?)................("?)/\1\2XXX\3/' } -notmuch_search_files_sanitize() +notmuch_search_files_sanitize () +{ + notmuch_dir_sanitize +} + +notmuch_dir_sanitize () { - sed -e "s,$MAIL_DIR,MAIL_DIR," + sed -e "s,$MAIL_DIR,MAIL_DIR," -e "s,${PWD},CWD,g" "$@" } NOTMUCH_SHOW_FILENAME_SQUELCH='s,filename:.*/mail,filename:/XXX/mail,' @@ -720,6 +729,17 @@ notmuch_date_sanitize () sed \ -e 's/^Date: Fri, 05 Jan 2001 .*0000/Date: GENERATED_DATE/' } + +notmuch_uuid_sanitize () +{ + sed 's/[0-9a-f]\{8\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}/UUID/g' +} + +notmuch_built_with_sanitize () +{ + sed 's/^built_with[.]\(.*\)=.*$/built_with.\1=something/' +} + # End of notmuch helper functions # Use test_set_prereq to tell that a particular prerequisite is available. @@ -1172,7 +1192,7 @@ test_C () { echo "== stdout ==" > OUTPUT.stdout echo "== stderr ==" > OUTPUT.stderr ./${exec_file} "$@" 1>>OUTPUT.stdout 2>>OUTPUT.stderr - sed "s,${PWD},CWD,g" OUTPUT.stdout OUTPUT.stderr > OUTPUT + notmuch_dir_sanitize OUTPUT.stdout OUTPUT.stderr > OUTPUT } @@ -1314,10 +1334,23 @@ test -z "$NO_PYTHON" && test_set_prereq PYTHON ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS rm -f y +# convert variable from configure to more convenient form +case "$NOTMUCH_DEFAULT_XAPIAN_BACKEND" in + glass) + db_ending=glass + ;; + chert) + db_ending=DB + ;; + *) + error "Unknown Xapian backend $NOTMUCH_DEFAULT_XAPIAN_BACKEND" +esac # declare prerequisites for external binaries used in tests test_declare_external_prereq dtach test_declare_external_prereq emacs test_declare_external_prereq ${TEST_EMACSCLIENT} test_declare_external_prereq gdb test_declare_external_prereq gpg +test_declare_external_prereq openssl +test_declare_external_prereq gpgsm test_declare_external_prereq ${NOTMUCH_PYTHON}