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 15:22:32 +09: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 15:22:32 +09: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"))
|
|
|
|
(define setup-extended-key-format (setup* "extended-key-format"))
|
2017-03-20 10:30:08 +01:00
|
|
|
|
2017-05-11 17:17:12 +02:00
|
|
|
(define all-tests
|
|
|
|
(parse-makefile-expand (in-srcdir "tests" "openpgp" "Makefile.am")
|
|
|
|
(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
|
2022-11-24 15:22:32 +09:00
|
|
|
#f
|
2017-08-07 11:15:56 +02:00
|
|
|
(path-join "tests" "openpgp" name)
|
|
|
|
(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
|
|
|
|
(map (lambda (name)
|
|
|
|
(test::scm setup-use-keyring
|
2022-11-24 15:22:32 +09:00
|
|
|
"use-keyring"
|
|
|
|
(path-join "tests" "openpgp" name)
|
2017-08-07 11:15:56 +02:00
|
|
|
(in-srcdir "tests" "openpgp" name)
|
|
|
|
"--use-keyring")) all-tests)
|
|
|
|
(map (lambda (name)
|
|
|
|
(test::scm setup-extended-key-format
|
2022-11-24 15:22:32 +09:00
|
|
|
"extended-key-format"
|
|
|
|
(path-join "tests" "openpgp" name)
|
2017-08-07 11:15:56 +02:00
|
|
|
(in-srcdir "tests" "openpgp" name)
|
|
|
|
"--extended-key-format")) all-tests))))
|
|
|
|
|
|
|
|
tests)
|