mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-18 14:17:03 +01:00
tests: Skip Python tests if the bindings are not built.
* tests/gpgme/wrap.scm (python): Move variable... * tests/gpgme/gpgme-defs.scm (python): ... here. (run-python-tests?): New function. * tests/gpgme/run-tests.scm: Only run Python tests if the bindings can be located in GPGME's build directory. Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
parent
40b7911130
commit
d82abbb1b6
@ -171,3 +171,13 @@
|
|||||||
(else
|
(else
|
||||||
(expand-one (append acc (list (car v))) (cdr v))))))
|
(expand-one (append acc (list (car v))) (cdr v))))))
|
||||||
values)))
|
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)))))
|
||||||
|
@ -71,5 +71,7 @@
|
|||||||
-- ,@(:path cmpnts))))
|
-- ,@(:path cmpnts))))
|
||||||
(if (null? tests) (all-tests makefile (:key cmpnts)) tests))))
|
(if (null? tests) (all-tests makefile (:key cmpnts)) tests))))
|
||||||
`((("tests" "gpg") "c_tests" ,setup-c)
|
`((("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))))))
|
(("lang" "qt" "tests") "TESTS" ,setup-c))))))
|
||||||
|
@ -29,9 +29,6 @@
|
|||||||
(setenv "top_srcdir" gpgme-srcdir #t)
|
(setenv "top_srcdir" gpgme-srcdir #t)
|
||||||
(setenv "srcdir" (path-join gpgme-srcdir "tests" "gpg") #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)
|
(define (run what)
|
||||||
(if (string-suffix? (car what) ".py")
|
(if (string-suffix? (car what) ".py")
|
||||||
(begin
|
(begin
|
||||||
|
Loading…
x
Reference in New Issue
Block a user