aboutsummaryrefslogtreecommitdiffstats
path: root/tests/gpgme/wrap.scm
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2017-03-09 13:33:02 +0000
committerJustus Winter <[email protected]>2017-03-09 13:33:02 +0000
commit046a15a88c83b40a753b4ad7ecc1456efa5b527f (patch)
tree4c62f08c2492927452078f11814207683eb05286 /tests/gpgme/wrap.scm
parenttests: Rework environment setup. (diff)
downloadgnupg-046a15a88c83b40a753b4ad7ecc1456efa5b527f.tar.gz
gnupg-046a15a88c83b40a753b4ad7ecc1456efa5b527f.zip
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 <[email protected]>
Diffstat (limited to 'tests/gpgme/wrap.scm')
-rw-r--r--tests/gpgme/wrap.scm23
1 files changed, 14 insertions, 9 deletions
diff --git a/tests/gpgme/wrap.scm b/tests/gpgme/wrap.scm
index e8f2b1fa3..d338892b9 100644
--- a/tests/gpgme/wrap.scm
+++ b/tests/gpgme/wrap.scm
@@ -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