2017-03-20 10:30:08 +01:00
|
|
|
;; Copyright (C) 2017 g10 Code GmbH
|
|
|
|
;;
|
|
|
|
;; This file is part of GnuPG.
|
|
|
|
;;
|
|
|
|
;; GnuPG is free software; you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation; either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
;;
|
|
|
|
;; GnuPG is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
;;
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
;; along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
(export all-tests
|
|
|
|
;; Parse the Makefile.am to find all tests.
|
|
|
|
|
|
|
|
(load (with-path "makefile.scm"))
|
|
|
|
|
|
|
|
(define (expander filename port key)
|
|
|
|
(parse-makefile port key))
|
|
|
|
|
|
|
|
(define (parse filename key)
|
|
|
|
(parse-makefile-expand filename expander key))
|
|
|
|
|
|
|
|
(define setup
|
|
|
|
(make-environment-cache
|
|
|
|
(test::scm
|
2022-11-24 07:22:32 +01:00
|
|
|
#f
|
2017-03-20 10:30:08 +01:00
|
|
|
#f
|
|
|
|
(path-join "tests" "openpgp" "setup.scm")
|
2017-05-11 17:17:12 +02:00
|
|
|
(in-srcdir "tests" "openpgp" "setup.scm"))))
|
|
|
|
|
2017-06-19 10:17:57 +02:00
|
|
|
(define (qualify path variant)
|
|
|
|
(string-append "<" variant ">" path))
|
|
|
|
|
|
|
|
(define (setup* variant)
|
2017-05-11 17:17:12 +02:00
|
|
|
(make-environment-cache
|
|
|
|
(test::scm
|
|
|
|
#f
|
2022-11-24 07:22:32 +01:00
|
|
|
variant
|
|
|
|
(path-join "tests" "openpgp" "setup.scm")
|
2017-03-20 10:30:08 +01:00
|
|
|
(in-srcdir "tests" "openpgp" "setup.scm")
|
2017-06-19 10:17:57 +02:00
|
|
|
(string-append "--" variant))))
|
|
|
|
|
|
|
|
(define setup-use-keyring (setup* "use-keyring"))
|
2020-09-24 10:35:05 +02:00
|
|
|
(define setup-use-keyboxd (setup* "use-keyboxd"))
|
2017-03-20 10:30:08 +01:00
|
|
|
|
2017-05-11 17:17:12 +02:00
|
|
|
(define all-tests
|
2022-04-26 03:53:30 +02:00
|
|
|
(parse-makefile-expand (in-srcdir "tests" "openpgp" "Makefile.am")
|
2017-05-11 17:17:12 +02:00
|
|
|
(lambda (filename port key) (parse-makefile port key))
|
|
|
|
"XTESTS"))
|
2017-08-07 11:15:56 +02:00
|
|
|
|
2022-05-10 04:49:06 +02:00
|
|
|
(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"))))
|
|
|
|
|
2017-08-07 11:15:56 +02:00
|
|
|
(define tests
|
|
|
|
(map (lambda (name)
|
|
|
|
(test::scm setup
|
2022-11-24 07:22:32 +01:00
|
|
|
"standard"
|
|
|
|
(path-join "tests" "openpgp" name)
|
2017-08-07 11:15:56 +02:00
|
|
|
(in-srcdir "tests" "openpgp" name))) all-tests))
|
|
|
|
|
2017-08-08 17:28:25 +02:00
|
|
|
(when *run-all-tests*
|
2017-08-07 11:15:56 +02:00
|
|
|
(set! tests
|
|
|
|
(append
|
|
|
|
tests
|
2022-05-10 04:49:06 +02:00
|
|
|
;; The second pass uses the keyboxd
|
|
|
|
(if keyboxd-enabled?
|
|
|
|
(map (lambda (name)
|
|
|
|
(test::scm setup-use-keyboxd
|
2022-11-24 07:22:32 +01:00
|
|
|
"keyboxd"
|
|
|
|
(path-join "tests" "openpgp" name)
|
2022-05-10 04:49:06 +02:00
|
|
|
(in-srcdir "tests" "openpgp" name)
|
|
|
|
"--use-keyboxd")) all-tests))
|
2024-05-13 00:09:23 +02:00
|
|
|
;; The third pass uses the legacy pubring.gpg
|
2017-08-07 11:15:56 +02:00
|
|
|
(map (lambda (name)
|
2020-09-24 10:35:05 +02:00
|
|
|
(test::scm setup-use-keyring
|
2022-11-24 07:22:32 +01:00
|
|
|
"keyring"
|
|
|
|
(path-join "tests" "openpgp" name)
|
2017-08-07 11:15:56 +02:00
|
|
|
(in-srcdir "tests" "openpgp" name)
|
2022-11-24 07:22:32 +01:00
|
|
|
"--use-keyring")) all-tests))))
|
2017-08-07 11:15:56 +02:00
|
|
|
|
|
|
|
tests)
|