1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

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@g10code.com>
This commit is contained in:
Justus Winter 2016-11-07 17:44:34 +01:00
parent abe0cc7a21
commit 26df829fa2
2 changed files with 13 additions and 11 deletions

View file

@ -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