summaryrefslogtreecommitdiff
path: root/tests/tstunt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tstunt')
-rwxr-xr-xtests/tstunt/gpg14
-rwxr-xr-xtests/tstunt/gpg-withagent2
2 files changed, 15 insertions, 1 deletions
diff --git a/tests/tstunt/gpg b/tests/tstunt/gpg
index 79d8319..7e12846 100755
--- a/tests/tstunt/gpg
+++ b/tests/tstunt/gpg
@@ -3,4 +3,18 @@ set -e
exec \
with-lock-ex -w "$DGIT_TEST_GNUPG_GLOBAL_LOCK" \
+ sh -c '
+ "$@" 9>&2 2>>"$DGIT_TEST_GNUPG_LOG"
+ rc=$?
+ if [ rc = 0 ]; then exit 0; fi
+ if [ "x$DGIT_TEST_BYHAND" != x ]; then
+ echo >&2 "BYHAND, not catting $DGIT_TEST_GNUPG_LOG"
+ else
+ echo >&2 "########################################"
+ echo >&2 "$DGIT_TEST_GNUPG_LOG"
+ cat >&2 "$DGIT_TEST_GNUPG_LOG"
+ echo >&2 "end of $DGIT_TEST_GNUPG_LOG"
+ fi
+ exit $rc
+ ' x \
"$DGIT_TEST_TROOT"/tstunt/gpg-withagent "$@"
diff --git a/tests/tstunt/gpg-withagent b/tests/tstunt/gpg-withagent
index 4b2ee1a..b7b8bfd 100755
--- a/tests/tstunt/gpg-withagent
+++ b/tests/tstunt/gpg-withagent
@@ -51,7 +51,7 @@ d
set +e
$DGIT_TEST_REAL_GPG \
- --agent-program=$DGIT_STUNT_AGENT "$@"
+ --agent-program=$DGIT_STUNT_AGENT "$@" 2>&9
rc=$?
set -e