[git] GnuPG - branch, master, updated. gnupg-2.1.13-123-g2f61aa0

by Justus Winter cvs at cvs.gnupg.org
Thu Jul 7 16:58:05 CEST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, master has been updated
       via  2f61aa0ff11b194d20307751ab686c87cd47dd56 (commit)
      from  511c2522b95333226a5e45e538fed29dd44c9be3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2f61aa0ff11b194d20307751ab686c87cd47dd56
Author: Justus Winter <justus at g10code.com>
Date:   Thu Jul 7 16:18:10 2016 +0200

    gpgscm: Capture output of spawned processes.
    
    * tests/gpgscm/tests.scm (call-check): Capture stdout and stderr, and
    return stdout if the child exited successfully, or include stderr in
    the error.
    * tests/openpgp/version.scm: Demonstrate this by checking the stdout.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/gpgscm/tests.scm b/tests/gpgscm/tests.scm
index 2728817..c32e2fa 100644
--- a/tests/gpgscm/tests.scm
+++ b/tests/gpgscm/tests.scm
@@ -94,9 +94,6 @@
 		 CLOSED_FD
 		 (if (< *verbose* 0) STDOUT_FILENO CLOSED_FD)
 		 (if (< *verbose* 0) STDERR_FILENO CLOSED_FD)))
-(define (call-check what)
-  (if (not (= 0 (call what)))
-      (throw (list what "failed"))))
 
 ;; Accessor functions for the results of 'spawn-process'.
 (define :stdin car)
@@ -119,6 +116,12 @@
 ;; ':stderr' can also be used.
 (define :retcode car)
 
+(define (call-check what)
+  (let ((result (call-with-io what "")))
+    (if (= 0 (:retcode result))
+	(:stdout result)
+	(throw (list what "failed:" (:stderr result))))))
+
 (define (call-popen command input-string)
   (let ((result (call-with-io command input-string)))
     (if (= 0 (:retcode result))
diff --git a/tests/openpgp/version.scm b/tests/openpgp/version.scm
index dbcb484..57efb93 100755
--- a/tests/openpgp/version.scm
+++ b/tests/openpgp/version.scm
@@ -20,6 +20,5 @@
 (load (with-path "defs.scm"))
 
 (info "Printing the GPG version")
-(assert (= 0 (call `(, at GPG --version))))
-
-;; fixme: check that the output is as expected
+(assert (string-contains? (call-check `(, at GPG --version))
+			  "gpg (GnuPG) 2."))

-----------------------------------------------------------------------

Summary of changes:
 tests/gpgscm/tests.scm    | 9 ++++++---
 tests/openpgp/version.scm | 5 ++---
 2 files changed, 8 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list