aboutsummaryrefslogtreecommitdiffstats
path: root/tests/gpgscm/tests.scm
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2016-07-26 13:53:50 +0000
committerJustus Winter <[email protected]>2016-07-26 13:53:50 +0000
commitf17aecbcd98103fcd2ece537be96930f354de656 (patch)
treeed1492b60b4d254a49631669c5b2deed0b53573b /tests/gpgscm/tests.scm
parentcommon: Avoid excessive stack use. (diff)
downloadgnupg-f17aecbcd98103fcd2ece537be96930f354de656.tar.gz
gnupg-f17aecbcd98103fcd2ece537be96930f354de656.zip
gpgscm: Make the verbose setting more useful.
* tests/gpgscm/ffi.c (do_get_verbose): New function. (do_set_verbose): Likewise. (ffi_init): Turn *verbose* into a function, add *set-verbose!*. * tests/gpgscm/tests.scm (call): Adapt accordingly. (call-with-io): Dump output if *verbose* is high. (pipe-do): Adapt accordingly. * tests/openpgp/defs.scm: Set verbosity according to environment. * tests/openpgp/run-tests.scm (test): Adapt accordingly. Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to '')
-rw-r--r--tests/gpgscm/tests.scm11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/gpgscm/tests.scm b/tests/gpgscm/tests.scm
index e14e0e3b0..f97b22e66 100644
--- a/tests/gpgscm/tests.scm
+++ b/tests/gpgscm/tests.scm
@@ -92,8 +92,8 @@
(define (call what)
(call-with-fds what
CLOSED_FD
- (if (< *verbose* 0) STDOUT_FILENO CLOSED_FD)
- (if (< *verbose* 0) STDERR_FILENO CLOSED_FD)))
+ (if (< (*verbose*) 0) STDOUT_FILENO CLOSED_FD)
+ (if (< (*verbose*) 0) STDERR_FILENO CLOSED_FD)))
;; Accessor functions for the results of 'spawn-process'.
(define :stdin car)
@@ -110,6 +110,11 @@
(result (wait-process (car what) (:pid h) #t)))
(es-fclose (:stdout h))
(es-fclose (:stderr h))
+ (if (> (*verbose*) 2)
+ (begin
+ (echo (stringify what) "returned:" result)
+ (echo (stringify what) "wrote to stdout:" out)
+ (echo (stringify what) "wrote to stderr:" err)))
(list result out err))))
;; Accessor function for the results of 'call-with-io'. ':stdout' and
@@ -360,7 +365,7 @@
(lambda (M)
(define (do-spawn M new-source)
(let ((pid (spawn-process-fd command M::source M::sink
- (if (> *verbose* 0)
+ (if (> (*verbose*) 0)
STDERR_FILENO CLOSED_FD)))
(M' (M::set-source new-source)))
(M'::add-proc command pid)))