]> git.notmuchmail.org Git - notmuch/blobdiff - test/test-lib.sh
test: print test description also for failing known broken tests
[notmuch] / test / test-lib.sh
index bb32e97b2af747b35a2db1d82b44d6cc8333d244..79dc8419950c5db76d8310bc0f0d5b22ce7c341a 100644 (file)
@@ -230,19 +230,10 @@ 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"
 }
 
@@ -280,6 +271,8 @@ die () {
 GIT_EXIT_OK=
 # Note: TEST_TMPDIR *NOT* exported!
 TEST_TMPDIR=$(mktemp -d "${TMPDIR:-/tmp}/notmuch-test-$$.XXXXXX")
+# Put GNUPGHOME in TMPDIR to avoid problems with long paths.
+export GNUPGHOME="${TEST_TMPDIR}/gnupg"
 trap 'trap_exit' EXIT
 trap 'trap_signal' HUP INT TERM
 
@@ -745,7 +738,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'
 }
@@ -858,12 +851,12 @@ test_ok_ () {
 }
 
 test_failure_ () {
+       print_test_description
        if test "$test_subtest_known_broken_" = "t"; then
                test_known_broken_failure_ "$@"
                return
        fi
        test_failure=$(($test_failure + 1))
-       print_test_description
        test_failure_message_ "FAIL" "$test_subtest_name" "$@"
        test "$immediate" = "" || { GIT_EXIT_OK=t; exit 1; }
        return 1
@@ -1286,11 +1279,6 @@ 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