X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2Ftest-lib.sh;h=bb32e97b2af747b35a2db1d82b44d6cc8333d244;hp=6f9468ae43bc22760b11b72ed7547d8cacb0b8d6;hb=2c5eed16b3b0bff9b6f488d3949ebdb62e8d1c35;hpb=32065e79090ce27c609db6a2fc07e134f1d3d4df diff --git a/test/test-lib.sh b/test/test-lib.sh index 6f9468ae..bb32e97b 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -230,10 +230,19 @@ test_fixed=0 test_broken=0 test_success=0 + +_shutdown_gpg_agent () { + if [ ${NOTMUCH_HAVE_GPGCONF_SOCKETDIR} = 1 ]; then + gpgconf --kill gpg-agent + gpgconf --remove-socketdir + fi +} + _exit_common () { code=$? trap - EXIT set +ex + _shutdown_gpg_agent rm -rf "$TEST_TMPDIR" } @@ -658,7 +667,7 @@ test_expect_equal_json () { # Sort the top-level list of JSON data from stdin. test_sort_json () { - PYTHONIOENCODING=utf-8 python -c \ + PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -c \ "import sys, json; json.dump(sorted(json.load(sys.stdin)),sys.stdout)" } @@ -1277,6 +1286,11 @@ test_init_ () { . ./test-lib-common.sh || exit 1 +# we need the setting of GNUPGHOME in test-lib-common.sh +if [ ${NOTMUCH_HAVE_GPGCONF_SOCKETDIR} = 1 ]; then + gpgconf --create-socketdir +fi + emacs_generate_script