]> git.notmuchmail.org Git - notmuch/blobdiff - test/test-lib.sh
cli/show: list all filenames of a message in the formatted output
[notmuch] / test / test-lib.sh
index 6f9468ae43bc22760b11b72ed7547d8cacb0b8d6..d8e159437ca9b8fa159e2a776260adc36025e86a 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"
 }
 
@@ -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)"
 }
 
@@ -736,7 +745,7 @@ notmuch_json_show_sanitize ()
        -e 's|"id": "[^"]*",|"id": "XXXXX",|g' \
        -e 's|"Date": "Fri, 05 Jan 2001 [^"]*0000"|"Date": "GENERATED_DATE"|g' \
        -e 's|"filename": "signature.asc",||g' \
-       -e 's|"filename": "/[^"]*",|"filename": "YYYYY",|g' \
+       -e 's|"filename": \["/[^"]*"\],|"filename": \["YYYYY"\],|g' \
        -e 's|"timestamp": 97.......|"timestamp": 42|g' \
         -e 's|"content-length": [1-9][0-9]*|"content-length": "NONZERO"|g'
 }
@@ -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