]> git.notmuchmail.org Git - notmuch/blobdiff - test/test-lib.sh
Merge branch 'release'
[notmuch] / test / test-lib.sh
index 6f9468ae43bc22760b11b72ed7547d8cacb0b8d6..67be917eb94299c609773ab31a2d798c5b172daa 100644 (file)
@@ -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"
 }
 
@@ -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