summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2022-05-10 04:49:06 +0200
committerNIIBE Yutaka <gniibe@fsij.org>2022-05-10 04:49:06 +0200
commit09df630e4be7c44b89183181c1643f50ad606ae2 (patch)
treefecec12c3784b63a9820f9c66ecedf9d7e8657f7 /tests
parentscd:p15: Improve the displayed S/N for Technology Nexus cards. (diff)
downloadgnupg2-09df630e4be7c44b89183181c1643f50ad606ae2.tar.xz
gnupg2-09df630e4be7c44b89183181c1643f50ad606ae2.zip
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>
Diffstat (limited to 'tests')
-rw-r--r--tests/gpgscm/tests.scm3
-rw-r--r--tests/openpgp/all-tests.scm26
2 files changed, 20 insertions, 9 deletions
diff --git a/tests/gpgscm/tests.scm b/tests/gpgscm/tests.scm
index dbeda74d7..eb278e301 100644
--- a/tests/gpgscm/tests.scm
+++ b/tests/gpgscm/tests.scm
@@ -192,6 +192,9 @@
(define (in-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.
(define (pathsep-split s)
(string-split s *pathsep*))
diff --git a/tests/openpgp/all-tests.scm b/tests/openpgp/all-tests.scm
index 3b266d595..98a8a6507 100644
--- a/tests/openpgp/all-tests.scm
+++ b/tests/openpgp/all-tests.scm
@@ -52,6 +52,13 @@
(lambda (filename port key) (parse-makefile port key))
"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
(map (lambda (name)
(test::scm setup
@@ -62,20 +69,21 @@
(set! tests
(append
tests
- ;; The second pass uses the keyboxd
- (map (lambda (name)
- (test::scm setup-use-keyboxd
- (qualify (path-join "tests" "openpgp" name)
- "keyboxd")
- (in-srcdir "tests" "openpgp" name)
- "--use-keyboxd")) all-tests)
- ;; The third pass uses the legact pubring.gpg
+ ;; The second pass uses the keyboxd
+ (if keyboxd-enabled?
+ (map (lambda (name)
+ (test::scm setup-use-keyboxd
+ (qualify (path-join "tests" "openpgp" name)
+ "keyboxd")
+ (in-srcdir "tests" "openpgp" name)
+ "--use-keyboxd")) all-tests))
+ ;; The third pass uses the legact pubring.gpg
(map (lambda (name)
(test::scm setup-use-keyring
(qualify (path-join "tests" "openpgp" name)
"keyring")
(in-srcdir "tests" "openpgp" name)
"--use-keyring")) all-tests)
- )))
+ )))
tests)