tests: Enable tests with keyboxd only when it's configured.

* tests/gpgscm/tests.scm (in-objdir): Move from...
* g13/all-tests.scm: ... here.
* tests/openpgp/all-tests.scm (keyboxd-enabled?): New.
(tests): Enable when keyboxd-enabled?.

--

GnuPG-bug-id: 5966
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2022-05-10 11:49:06 +09:00
parent 3d7d7e8bfd
commit 09df630e4b
3 changed files with 20 additions and 12 deletions

View File

@ -26,9 +26,6 @@
(define (parse filename key) (define (parse filename key)
(parse-makefile-expand filename expander key)) (parse-makefile-expand filename expander key))
(define (in-objdir . names)
(canonical-path (apply path-join (cons (getenv "objdir") names))))
(define g13-enabled? (define g13-enabled?
;; Parse the variable "g13" in the Makefile ;; Parse the variable "g13" in the Makefile
(not (null? (not (null?

View File

@ -192,6 +192,9 @@
(define (in-srcdir . names) (define (in-srcdir . names)
(canonical-path (apply path-join (cons (getenv "abs_top_srcdir") names)))) (canonical-path (apply path-join (cons (getenv "abs_top_srcdir") names))))
(define (in-objdir . names)
(canonical-path (apply path-join (cons (getenv "objdir") names))))
;; Split a list of paths. ;; Split a list of paths.
(define (pathsep-split s) (define (pathsep-split s)
(string-split s *pathsep*)) (string-split s *pathsep*))

View File

@ -52,6 +52,13 @@
(lambda (filename port key) (parse-makefile port key)) (lambda (filename port key) (parse-makefile port key))
"XTESTS")) "XTESTS"))
(define keyboxd-enabled?
;; Parse the variable "libexec_PROGRAMS" in kbx/Makefile
(not (null?
(parse-makefile-expand (in-objdir "kbx" "Makefile")
(lambda (filename port key) (parse-makefile port key))
"libexec_PROGRAMS"))))
(define tests (define tests
(map (lambda (name) (map (lambda (name)
(test::scm setup (test::scm setup
@ -62,20 +69,21 @@
(set! tests (set! tests
(append (append
tests tests
;; The second pass uses the keyboxd ;; The second pass uses the keyboxd
(map (lambda (name) (if keyboxd-enabled?
(test::scm setup-use-keyboxd (map (lambda (name)
(qualify (path-join "tests" "openpgp" name) (test::scm setup-use-keyboxd
"keyboxd") (qualify (path-join "tests" "openpgp" name)
(in-srcdir "tests" "openpgp" name) "keyboxd")
"--use-keyboxd")) all-tests) (in-srcdir "tests" "openpgp" name)
;; The third pass uses the legact pubring.gpg "--use-keyboxd")) all-tests))
;; The third pass uses the legact pubring.gpg
(map (lambda (name) (map (lambda (name)
(test::scm setup-use-keyring (test::scm setup-use-keyring
(qualify (path-join "tests" "openpgp" name) (qualify (path-join "tests" "openpgp" name)
"keyring") "keyring")
(in-srcdir "tests" "openpgp" name) (in-srcdir "tests" "openpgp" name)
"--use-keyring")) all-tests) "--use-keyring")) all-tests)
))) )))
tests) tests)