]> 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 d8e159437ca9b8fa159e2a776260adc36025e86a..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
 
@@ -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