1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

tests: Run the tests for the Python bindings of GPGME.

* tests/gpgme/gpgme-defs.scm (create-file): Write lines.
(create-gpgmehome): Extend function to create the right environment
for the Python tests.
* tests/gpgme/run-tests.scm: Make an environment cache for the Python
tests and enable them.
* tests/gpgme/wrap.scm: Do not hardcode the path of the Python
interpreter.

Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
Justus Winter 2017-03-09 14:33:02 +01:00
parent cca91a3f8f
commit 046a15a88c
No known key found for this signature in database
GPG key ID: DD1A52F9DA8C9020
3 changed files with 51 additions and 15 deletions

View file

@ -29,6 +29,9 @@
(setenv "top_srcdir" gpgme-srcdir #t)
(setenv "srcdir" (path-join gpgme-srcdir "tests" "gpg") #t)
(define python (catch #f
(path-expand "python" (string-split (getenv "PATH") *pathsep*))))
(define (run what)
(if (string-suffix? (car what) ".py")
(begin
@ -39,15 +42,17 @@
(getenv "LD_LIBRARY_PATH"))
(path-join gpgme-builddir "src/.libs"))
#t)
(call-with-fds
`("/usr/bin/python"
,(in-gpgme-srcdir "lang" "python" "tests" "run-tests.py")
--quiet
--interpreters=/usr/bin/python
--builddir ,(path-join gpgme-builddir "lang" "python" "tests")
,@what)
STDIN_FILENO STDOUT_FILENO STDERR_FILENO))
(if #f 77 (call-with-fds what STDIN_FILENO STDOUT_FILENO STDERR_FILENO))))
(if python
(call-with-fds
`(,python
,(in-gpgme-srcdir "lang" "python" "tests" "run-tests.py")
--quiet
,(string-append "--interpreters=" python)
--builddir ,(path-join gpgme-builddir "lang" "python" "tests")
,@what)
STDIN_FILENO STDOUT_FILENO STDERR_FILENO)
77))
(call-with-fds what STDIN_FILENO STDOUT_FILENO STDERR_FILENO)))
(let ((name (basename (car executable))))
(cond