[Pkg-gnupg-commit] [gnupg2] 220/292: tests: Write a log file for each test.
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Mon Nov 21 06:31:44 UTC 2016
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch master
in repository gnupg2.
commit 26df829fa22f027ca4a5eaf155cdaa2123afbdd5
Author: Justus Winter <justus at g10code.com>
Date: Mon Nov 7 17:44:34 2016 +0100
tests: Write a log file for each test.
* tests/openpgp/Makefile.am (CLEANFILES): Delete logs.
* tests/openpgp/run-tests.scm (test::run-sync): Write logs.
Signed-off-by: Justus Winter <justus at g10code.com>
---
tests/openpgp/Makefile.am | 2 +-
tests/openpgp/run-tests.scm | 22 ++++++++++++----------
2 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/tests/openpgp/Makefile.am b/tests/openpgp/Makefile.am
index cfdd58d..8f565b3 100644
--- a/tests/openpgp/Makefile.am
+++ b/tests/openpgp/Makefile.am
@@ -197,7 +197,7 @@ EXTRA_DIST = defs.scm $(XTESTS) $(TEST_FILES) \
CLEANFILES = prepared.stamp x y yy z out err $(data_files) \
plain-1 plain-2 plain-3 trustdb.gpg *.lock .\#lk* \
- *.test.log gpg_dearmor gpg.conf gpg-agent.conf S.gpg-agent \
+ *.log gpg_dearmor gpg.conf gpg-agent.conf S.gpg-agent \
pubring.gpg pubring.gpg~ pubring.kbx pubring.kbx~ \
secring.gpg pubring.pkr secring.skr \
gnupg-test.stop random_seed gpg-agent.log tofu.db \
diff --git a/tests/openpgp/run-tests.scm b/tests/openpgp/run-tests.scm
index ce0217b..9e9bc3d 100644
--- a/tests/openpgp/run-tests.scm
+++ b/tests/openpgp/run-tests.scm
@@ -83,16 +83,18 @@
(define (set-pid x)
(new name directory command x retcode))
(define (run-sync . args)
- (with-working-directory directory
- (let* ((p (inbound-pipe))
- (pid (spawn-process-fd (append command args) 0
- (:write-end p) (:write-end p))))
- (close (:write-end p))
- (splice (:read-end p) STDERR_FILENO)
- (close (:read-end p))
- (let ((t' (set-retcode (wait-process name pid #t))))
- (t'::report)
- t'))))
+ (letfd ((log (open (string-append name ".log")
+ (logior O_WRONLY O_BINARY O_CREAT) #o600)))
+ (with-working-directory directory
+ (let* ((p (inbound-pipe))
+ (pid (spawn-process-fd (append command args) 0
+ (:write-end p) (:write-end p))))
+ (close (:write-end p))
+ (splice (:read-end p) STDERR_FILENO log)
+ (close (:read-end p))
+ (let ((t' (set-retcode (wait-process name pid #t))))
+ (t'::report)
+ t')))))
(define (run-sync-quiet . args)
(with-working-directory directory
(set-retcode
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git
More information about the Pkg-gnupg-commit
mailing list