tests: Fix using tools from the build directory.

* tests/openpgp/defs.scm (gpg-conf'): Explicitly pass the build prefix
to gpgconf here...
(gpg-components): ... instead of only here.
--

Previously, gpgconf was not invoked with '--build-prefix' when
changing the configuration.  This made tests using this facility fail
(e.g. the TOFU test).  This only affected release builds, because in
development builds gpgconf picks up the build prefix from the
environment.

GnuPG-bug-id: 2979
Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
Justus Winter 2017-03-15 14:36:27 +01:00
parent c7833eca38
commit a98459d3f4
No known key found for this signature in database
GPG Key ID: DD1A52F9DA8C9020
1 changed files with 8 additions and 8 deletions

View File

@ -140,10 +140,16 @@
(define valgrind (define valgrind
'("/usr/bin/valgrind" --leak-check=full --error-exitcode=154)) '("/usr/bin/valgrind" --leak-check=full --error-exitcode=154))
(unless installed?
(setenv "GNUPG_BUILDDIR" (getenv "objdir") #t))
(define (gpg-conf . args) (define (gpg-conf . args)
(gpg-conf' "" args)) (gpg-conf' "" args))
(define (gpg-conf' input args) (define (gpg-conf' input args)
(let ((s (call-popen `(,(tool-hardcoded 'gpgconf) ,@args) input))) (let ((s (call-popen `(,(tool-hardcoded 'gpgconf)
,@(if installed? '()
(list '--build-prefix (getenv "objdir")))
,@args) input)))
(map (lambda (line) (map percent-decode (string-split line #\:))) (map (lambda (line) (map percent-decode (string-split line #\:)))
(string-split-newlines s)))) (string-split-newlines s))))
(define :gc:c:name car) (define :gc:c:name car)
@ -180,13 +186,7 @@
(gpg-conf' (string-append key ":16:") (gpg-conf' (string-append key ":16:")
`(--change-options ,component))))) `(--change-options ,component)))))
(define gpg-components (apply gpg-conf '(--list-components)))
(unless installed?
(setenv "GNUPG_BUILDDIR" (getenv "objdir") #t))
(define gpg-components (apply gpg-conf
`(,@(if installed? '()
(list '--build-prefix (getenv "objdir")))
--list-components)))
(define (tool which) (define (tool which)
(case which (case which