3 ;; Copyright (C) 2016 g10 Code GmbH
5 ;; This file is part of GnuPG.
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.
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.
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/>.
20 (load (with-path "gpgme-defs.scm"))
22 (define executable (flag "--executable" *args*))
23 (unless (and executable (not (null? executable)))
24 (error "Usage: wrap.scm --executable <file> [args...]"))
26 (setup-gpgme-environment "tests" "gpg")
28 (setenv "abs_builddir" (getcwd) #t)
29 (setenv "top_srcdir" gpgme-srcdir #t)
30 (setenv "srcdir" (path-join gpgme-srcdir "tests" "gpg") #t)
33 (if (string-suffix? (car what) ".py")
35 (setenv "LD_LIBRARY_PATH"
36 (if (< 0 (string-length (getenv "LD_LIBRARY_PATH")))
37 (string-append (path-join gpgme-builddir "src/.libs")
39 (getenv "LD_LIBRARY_PATH"))
40 (path-join gpgme-builddir "src/.libs"))
44 ,(in-gpgme-srcdir "lang" "python" "tests" "run-tests.py")
46 --interpreters=/usr/bin/python
47 --builddir ,(path-join gpgme-builddir "lang" "python" "tests")
49 STDIN_FILENO STDOUT_FILENO STDERR_FILENO))
50 (if #f 77 (call-with-fds what STDIN_FILENO STDOUT_FILENO STDERR_FILENO))))
52 (let ((name (basename (car executable))))
54 ((string=? "t-keylist" name)
55 ;; This test assumes that 't-import' imported a key.
56 (log "Importing extra key...")
57 (call-check `(,@GPG --yes --import ,(in-srcdir "pubkey-1.asc"))))))
59 (log "Running" (car executable))
60 (exit (run executable))