aboutsummaryrefslogtreecommitdiffstats
path: root/tests/openpgp/defs.inc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/openpgp/defs.inc')
-rwxr-xr-xtests/openpgp/defs.inc26
1 files changed, 15 insertions, 11 deletions
diff --git a/tests/openpgp/defs.inc b/tests/openpgp/defs.inc
index da7ee3020..3e46ebd61 100755
--- a/tests/openpgp/defs.inc
+++ b/tests/openpgp/defs.inc
@@ -162,7 +162,7 @@ pgmname=`basename $0`
[ -z "$srcdir" ] && fatal "not called from make"
# Make sure we have a valid option files even with VPATH builds.
-for f in gpg.conf gpg-agent.conf; do
+for f in gpg.conf ; do
if [ -f ./$f ]; then
:
elif [ -f $srcdir/$f.tmpl ]; then
@@ -170,19 +170,23 @@ for f in gpg.conf gpg-agent.conf; do
fi
done
-# Always work in the current directory
-GNUPGHOME=`pwd`
-export GNUPGHOME
-
-# We do not use an external info variable for gpg-agent because we use
-# a standard socket in the home directory. This way gpg-agent will be
-# started as soon as needed. It is terminated indirectly using a
-# Makefile rule.
-GPG_AGENT_INFO=
+# Always work in the current directory. We set GNUPGHOME only if it
+# has not been set already. Usually it is set through the Makefile's
+# TESTS_ENVIRONMENT macro.
+if [ -z "$GNUPGHOME" ]; then
+ GNUPGHOME=`pwd`
+ export GNUPGHOME
+elif [ "$GNUPGHOME" != `pwd` ]; then
+ echo "$pgmname: GNUPGHOME not set to the cwd" $* >&2
+ exit 1
+fi
GPG="../../g10/gpg2 --no-permission-warning "
-exec 5>&2 2>${pgmname}.log
+echo "Test: $pgmname" > ${pgmname}.log
+echo "GNUPGHOME=$GNUPGHOME" >> ${pgmname}.log
+echo "GPG_AGENT_INFO=$GPG_AGENT_INFO" >> ${pgmname}.log
+exec 5>&2 2>>${pgmname}.log
:
# end