X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=test%2Ftest-lib.sh;h=09f87319d7d6e93c1d068ce01118b2c9471d5dff;hb=792bea5aff135107fd970f51f3ef8c65f68194de;hp=eeb5487bd6a31c29acedc597932b924d4638ffed;hpb=d0553ad524f241ba42f685cba6745c8a3a9ba20a;p=notmuch diff --git a/test/test-lib.sh b/test/test-lib.sh index eeb5487b..09f87319 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -82,6 +82,9 @@ unset CDPATH unset GREP_OPTIONS +# For emacsclient +unset ALTERNATE_EDITOR + # Convenience # # A regexp to match 5 and 40 hexdigits @@ -96,7 +99,8 @@ _x32="$_x04$_x04$_x04$_x04$_x04$_x04$_x04$_x04" # test_description='Description of this test... # This test checks if command xyzzy does the right thing... # ' -# . ./test-lib.sh +# . ./test-lib.sh || exit 1 + [ "x$ORIGINAL_TERM" != "xdumb" ] && ( TERM=$ORIGINAL_TERM && export TERM && @@ -674,9 +678,14 @@ notmuch_search_sanitize () perl -pe 's/("?thread"?: ?)("?)................("?)/\1\2XXX\3/' } -notmuch_search_files_sanitize() +notmuch_search_files_sanitize () { - sed -e "s,$MAIL_DIR,MAIL_DIR," + notmuch_dir_sanitize +} + +notmuch_dir_sanitize () +{ + sed -e "s,$MAIL_DIR,MAIL_DIR," -e "s,${PWD},CWD,g" "$@" } NOTMUCH_SHOW_FILENAME_SQUELCH='s,filename:.*/mail,filename:/XXX/mail,' @@ -719,6 +728,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. @@ -1171,7 +1191,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 } @@ -1223,7 +1243,7 @@ test_init_ () { } -. ./test-lib-common.sh +. ./test-lib-common.sh || exit 1 emacs_generate_script @@ -1313,10 +1333,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}