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
|
|
|
|
#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
|
2017-06-19 10:17:57 +02:00
|
|
|
(qualify (path-join "tests" "openpgp" "setup.scm") variant)
|
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
|
2017-11-13 10:50:30 +01:00
|
|
|
(parse-makefile-expand "Makefile"
|
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
|
|
|
|
|
|
|
(define tests
|
|
|
|
(map (lambda (name)
|
|
|
|
(test::scm setup
|
2020-09-24 10:35:05 +02:00
|
|
|
(qualify (path-join "tests" "openpgp" name) "standard")
|
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
|
2020-09-24 10:35:05 +02:00
|
|
|
;; The second pass uses the keyboxd
|
2017-08-07 11:15:56 +02:00
|
|
|
(map (lambda (name)
|
2020-09-24 10:35:05 +02:00
|
|
|
(test::scm setup-use-keyboxd
|
2017-08-07 11:15:56 +02:00
|
|
|
(qualify (path-join "tests" "openpgp" name)
|
2020-09-24 10:35:05 +02:00
|
|
|
"keyboxd")
|
2017-08-07 11:15:56 +02:00
|
|
|
(in-srcdir "tests" "openpgp" name)
|
2020-09-24 10:35:05 +02:00
|
|
|
"--use-keyboxd")) all-tests)
|
|
|
|
;; The third pass uses the legact 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
|
2017-08-07 11:15:56 +02:00
|
|
|
(qualify (path-join "tests" "openpgp" name)
|
2020-09-24 10:35:05 +02:00
|
|
|
"keyring")
|
2017-08-07 11:15:56 +02:00
|
|
|
(in-srcdir "tests" "openpgp" name)
|
2020-09-24 10:35:05 +02:00
|
|
|
"--use-keyring")) all-tests)
|
|
|
|
)))
|
2017-08-07 11:15:56 +02:00
|
|
|
|
|
|
|
tests)
|