gpg: Allow import of PGP desktop exported secret keys.
[gnupg.git] / tests / run-tests.scm
1 #!/usr/bin/env gpgscm
2
3 ;; Copyright (C) 2017 g10 Code GmbH
4 ;;
5 ;; This file is part of GnuPG.
6 ;;
7 ;; GnuPG is free software; you can redistribute it and/or modify
8 ;; it under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation; either version 3 of the License, or
10 ;; (at your option) any later version.
11 ;;
12 ;; GnuPG is distributed in the hope that it will be useful,
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 ;; GNU General Public License for more details.
16 ;;
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with this program; if not, see <http://www.gnu.org/licenses/>.
19
20 (info "Running all tests...")
21
22 (define (load-tests-with-log . path)
23   (map (lambda (test)
24          (test:::set! 'log-file-name
25                       (apply path-join `(,@path
26                                          ,(string-append (basename test::name)
27                                                          ".log")))))
28        (apply load-tests path)))
29
30 (let ((prefix (flag "--prefix" *args*))
31       (all-tests (append
32                   (load-tests-with-log "common")
33                   (load-tests-with-log "g10")
34                   (load-tests-with-log "g13")
35                   (load-tests-with-log "agent")
36                   (load-tests-with-log "tests" "openpgp")
37                   (load-tests-with-log "tests" "migrations")
38                   (load-tests-with-log "tests" "gpgsm")
39                   (load-tests-with-log "tests" "gpgme"))))
40   (run-tests (if prefix
41                  (filter
42                   (lambda (t) (string-prefix? t::name (apply path-join prefix)))
43                   all-tests)
44                  all-tests)))