aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/gpgme/gpgme-defs.scm10
-rw-r--r--tests/gpgme/run-tests.scm4
-rw-r--r--tests/gpgme/wrap.scm3
3 files changed, 13 insertions, 4 deletions
diff --git a/tests/gpgme/gpgme-defs.scm b/tests/gpgme/gpgme-defs.scm
index 12e033cbd..2b104f264 100644
--- a/tests/gpgme/gpgme-defs.scm
+++ b/tests/gpgme/gpgme-defs.scm
@@ -171,3 +171,13 @@
(else
(expand-one (append acc (list (car v))) (cdr v))))))
values)))
+
+(define python (catch #f
+ (path-expand "python" (string-split (getenv "PATH") *pathsep*))))
+(define (run-python-tests?)
+ (let* ((python-version
+ (string-trim char-whitespace?
+ (call-popen `(,python -c "import sys; print('{0}.{1}'.format(sys.version_info[0], sys.version_info[1]))") "")))
+ (build-path (path-join gpgme-builddir "lang" "python"
+ (string-append "python" python-version "-gpg"))))
+ (trace (file-exists? (trace build-path)))))
diff --git a/tests/gpgme/run-tests.scm b/tests/gpgme/run-tests.scm
index 72de49580..be70f178d 100644
--- a/tests/gpgme/run-tests.scm
+++ b/tests/gpgme/run-tests.scm
@@ -71,5 +71,7 @@
-- ,@(:path cmpnts))))
(if (null? tests) (all-tests makefile (:key cmpnts)) tests))))
`((("tests" "gpg") "c_tests" ,setup-c)
- (("lang" "python" "tests") "py_tests" ,setup-py)
+ ,@(if (run-python-tests?)
+ `((("lang" "python" "tests") "py_tests" ,setup-py))
+ '())
(("lang" "qt" "tests") "TESTS" ,setup-c))))))
diff --git a/tests/gpgme/wrap.scm b/tests/gpgme/wrap.scm
index d338892b9..4c96a09ab 100644
--- a/tests/gpgme/wrap.scm
+++ b/tests/gpgme/wrap.scm
@@ -29,9 +29,6 @@
(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