X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2Ftest-lib.sh;h=72ac2e896604f7d976dd0cc7325036a9c581ec07;hb=049a652da7a692704348085a817b0086a44d5435;hp=29baa0c17d966f0012438aa7d60738778f819a7b;hpb=6a7b61b1d50bf25ebce61fa58af1c195951b387c;p=notmuch diff --git a/test/test-lib.sh b/test/test-lib.sh index 29baa0c1..72ac2e89 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -104,9 +104,16 @@ unset CDPATH unset GREP_OPTIONS +# For lib/open.cc:_load_key_file +unset XDG_CONFIG_HOME + # For emacsclient unset ALTERNATE_EDITOR +# for reproducibility +unset EMAIL +unset NAME + add_gnupg_home () { [ -e "${GNUPGHOME}/gpg.conf" ] && return @@ -585,6 +592,9 @@ test_emacs_expect_t () { exec 1>&6 2>&7 # Restore stdout and stderr inside_subtest= + # test_emacs may update missing external prerequisites + test_check_missing_external_prereqs_ "$test_subtest_name" && return + # Report success/failure. result=$(cat OUTPUT) if [ "$result" = t ] @@ -694,6 +704,27 @@ notmuch_built_with_sanitize () sed 's/^built_with[.]\(.*\)=.*$/built_with.\1=something/' } +notmuch_passwd_sanitize() +{ + ${NOTMUCH_PYTHON} -c' +import os, sys, pwd, socket + +pw = pwd.getpwuid(os.getuid()) +user = pw.pw_name +name = pw.pw_gecos.partition(",")[0] +fqdn = socket.getaddrinfo(socket.gethostname(), 0, 0, socket.SOCK_STREAM, 0, socket.AI_CANONNAME)[0][3] + +for l in sys.stdin: + if user: + l = l.replace(user, "USERNAME") + if fqdn: + l = l.replace(fqdn, "FQDN").replace(".(none)","") + if name: + l = l.replace(name, "USER_FULL_NAME") + sys.stdout.write(l) +' +} + notmuch_config_sanitize () { notmuch_dir_sanitize | notmuch_built_with_sanitize @@ -891,7 +922,7 @@ test_expect_success () { test_run_ "$1" run_ret="$?" # test_run_ may update missing external prerequisites - test_check_missing_external_prereqs_ "$@" || + test_check_missing_external_prereqs_ "$test_subtest_name" || if [ "$run_ret" = 0 -a "$eval_ret" = 0 ] then test_ok_ @@ -915,7 +946,7 @@ test_expect_code () { test_run_ "$2" run_ret="$?" # test_run_ may update missing external prerequisites, - test_check_missing_external_prereqs_ "$@" || + test_check_missing_external_prereqs_ "$test_subtest_name" || if [ "$run_ret" = 0 -a "$eval_ret" = "$1" ] then test_ok_ @@ -1117,7 +1148,7 @@ notmuch_with_shim () { base_name="$1" shift shim_file="${base_name}.so" - LD_PRELOAD=./${shim_file}${LD_PRELOAD:+:$LD_PRELOAD} notmuch-shared "$@" + LD_PRELOAD=${LD_PRELOAD:+:$LD_PRELOAD}:./${shim_file} notmuch-shared "$@" } # Creates a script that counts how much time it is executed and calls @@ -1271,3 +1302,4 @@ test_declare_external_prereq openssl test_declare_external_prereq gpgsm test_declare_external_prereq ${NOTMUCH_PYTHON} test_declare_external_prereq xapian-metadata +test_declare_external_prereq xapian-delve