mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-08 12:44:23 +01:00
tests: Fix to support --enable-all-tests and variants.
* tests/gpgscm/tests.scm (test::scm): Add VARIANT argument. (tests::new): Likewise. (open-log-file, report): Support VARIANT. * tests/gpgme/all-tests.scm (setup-c, setup-py): Follow the change. * tests/gpgsm/all-tests.scm (setup): Likewise. * tests/gpgsm/run-tests.scm: Likewise. * tests/migrations/all-tests.scm: Likewise. * tests/migrations/run-tests.scm: Likewise. * tests/openpgp/all-tests.scm: Likewise. * tests/openpgp/run-tests.scm: Likewise. -- Fixes-commit: 1c88104a3f00f7ca3790fbaab8f67b2b68cd6e18 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
754175a46d
commit
0fd7a90207
tests
gpgme
gpgscm
gpgsm
migrations
openpgp
@ -39,6 +39,7 @@
|
||||
(define setup-c
|
||||
(make-environment-cache
|
||||
(test::scm
|
||||
#f
|
||||
#f
|
||||
(path-join "tests" "gpgme" "setup.scm" "tests" "gpg")
|
||||
(in-srcdir "tests" "gpgme" "setup.scm")
|
||||
@ -46,6 +47,7 @@
|
||||
(define setup-py
|
||||
(make-environment-cache
|
||||
(test::scm
|
||||
#f
|
||||
#f
|
||||
(path-join "tests" "gpgme" "setup.scm" "lang" "python" "tests")
|
||||
(in-srcdir "tests" "gpgme" "setup.scm")
|
||||
@ -71,6 +73,7 @@
|
||||
(map (lambda (name)
|
||||
(apply test::scm
|
||||
`(,(:setup cmpnts)
|
||||
#f
|
||||
,(apply path-join
|
||||
`("tests" "gpgme" ,@(:path cmpnts) ,name))
|
||||
,(in-srcdir "tests" "gpgme" "wrap.scm")
|
||||
|
@ -670,14 +670,14 @@
|
||||
name))
|
||||
|
||||
(package
|
||||
(define (scm setup name path . args)
|
||||
(define (scm setup variant name path . args)
|
||||
;; Start the process.
|
||||
(define (spawn-scm args' in out err)
|
||||
(spawn-process-fd `(,*argv0* ,@(verbosity (*verbose*))
|
||||
,(locate-test (test-name path))
|
||||
,@(if setup (force setup) '())
|
||||
,@args' ,@args) in out err))
|
||||
(new name #f spawn-scm #f #f CLOSED_FD (expect-failure? name)))
|
||||
(new variant name #f spawn-scm #f #f CLOSED_FD (expect-failure? name)))
|
||||
|
||||
(define (binary setup name path . args)
|
||||
;; Start the process.
|
||||
@ -685,9 +685,9 @@
|
||||
(spawn-process-fd `(,(test-name path)
|
||||
,@(if setup (force setup) '()) ,@args' ,@args)
|
||||
in out err))
|
||||
(new name #f spawn-binary #f #f CLOSED_FD (expect-failure? name)))
|
||||
(new #f name #f spawn-binary #f #f CLOSED_FD (expect-failure? name)))
|
||||
|
||||
(define (new name directory spawn pid retcode logfd expect-failure)
|
||||
(define (new variant name directory spawn pid retcode logfd expect-failure)
|
||||
(package
|
||||
|
||||
;; XXX: OO glue.
|
||||
@ -718,7 +718,9 @@
|
||||
(unless log-file-name
|
||||
(set! log-file-name (path-join
|
||||
(getenv "objdir")
|
||||
(string-append name ".log"))))
|
||||
(if variant
|
||||
(string-append name "." variant ".log")
|
||||
(string-append name ".log")))))
|
||||
(catch '() (unlink log-file-name))
|
||||
(open log-file-name (logior O_RDWR O_BINARY O_CREAT) #o600))
|
||||
|
||||
@ -767,7 +769,10 @@
|
||||
(seek logfd 0 SEEK_SET)
|
||||
(splice logfd STDERR_FILENO)
|
||||
(close logfd))
|
||||
(echo (string-append (status-string) ":") name))
|
||||
(echo (string-append (status-string) ":")
|
||||
(if variant
|
||||
(string-append "<" variant ">" name)
|
||||
name)))
|
||||
|
||||
(define (xml)
|
||||
(xx::tag
|
||||
|
@ -29,6 +29,7 @@
|
||||
(define setup
|
||||
(make-environment-cache
|
||||
(test::scm
|
||||
#f
|
||||
#f
|
||||
(path-join "tests" "gpgsm" "setup.scm")
|
||||
(in-srcdir "tests" "gpgsm" "setup.scm")
|
||||
@ -36,6 +37,7 @@
|
||||
|
||||
(map (lambda (name)
|
||||
(test::scm setup
|
||||
#f
|
||||
(path-join "tests" "gpgsm" name)
|
||||
(in-srcdir "tests" "gpgsm" name)))
|
||||
(parse-makefile-expand (in-srcdir "tests" "gpgsm" "Makefile.am")
|
||||
|
@ -27,6 +27,7 @@
|
||||
|
||||
(define setup
|
||||
(make-environment-cache (test::scm
|
||||
#f
|
||||
#f
|
||||
(path-join "tests" "gpgsm" "setup.scm")
|
||||
(in-srcdir "tests" "gpgsm" "setup.scm"))))
|
||||
@ -35,5 +36,6 @@
|
||||
(load-tests "tests" "gpgsm")
|
||||
(map (lambda (name)
|
||||
(test::scm setup
|
||||
#f
|
||||
(path-join "tests" "gpgsm" name)
|
||||
(in-srcdir "tests" "gpgsm" name))) tests)))
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
(map (lambda (name)
|
||||
(test::scm #f
|
||||
#f
|
||||
(path-join "tests" "migrations" name)
|
||||
(in-srcdir "tests" "migrations" name)))
|
||||
(parse-makefile-expand (in-srcdir "tests" "migrations" "Makefile.am")
|
||||
|
@ -23,5 +23,6 @@
|
||||
(load-tests "tests" "migrations")
|
||||
(map (lambda (name)
|
||||
(test::scm #f
|
||||
#f
|
||||
(path-join "tests" "migrations" name)
|
||||
(in-srcdir "tests" "migrations" name))) tests)))
|
||||
|
@ -29,6 +29,7 @@
|
||||
(define setup
|
||||
(make-environment-cache
|
||||
(test::scm
|
||||
#f
|
||||
#f
|
||||
(path-join "tests" "openpgp" "setup.scm")
|
||||
(in-srcdir "tests" "openpgp" "setup.scm"))))
|
||||
@ -40,7 +41,8 @@
|
||||
(make-environment-cache
|
||||
(test::scm
|
||||
#f
|
||||
(qualify (path-join "tests" "openpgp" "setup.scm") variant)
|
||||
variant
|
||||
(path-join "tests" "openpgp" "setup.scm")
|
||||
(in-srcdir "tests" "openpgp" "setup.scm")
|
||||
(string-append "--" variant))))
|
||||
|
||||
@ -55,6 +57,7 @@
|
||||
(define tests
|
||||
(map (lambda (name)
|
||||
(test::scm setup
|
||||
#f
|
||||
(path-join "tests" "openpgp" name)
|
||||
(in-srcdir "tests" "openpgp" name))) all-tests))
|
||||
|
||||
@ -64,14 +67,14 @@
|
||||
tests
|
||||
(map (lambda (name)
|
||||
(test::scm setup-use-keyring
|
||||
(qualify (path-join "tests" "openpgp" name)
|
||||
"use-keyring")
|
||||
"use-keyring"
|
||||
(path-join "tests" "openpgp" name)
|
||||
(in-srcdir "tests" "openpgp" name)
|
||||
"--use-keyring")) all-tests)
|
||||
(map (lambda (name)
|
||||
(test::scm setup-extended-key-format
|
||||
(qualify (path-join "tests" "openpgp" name)
|
||||
"extended-key-format")
|
||||
"extended-key-format"
|
||||
(path-join "tests" "openpgp" name)
|
||||
(in-srcdir "tests" "openpgp" name)
|
||||
"--extended-key-format")) all-tests))))
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
(define setup
|
||||
(make-environment-cache (test::scm
|
||||
#f
|
||||
#f
|
||||
(path-join "tests" "openpgp" "setup.scm")
|
||||
(in-srcdir "tests" "openpgp" "setup.scm"))))
|
||||
@ -38,5 +39,6 @@
|
||||
(load-tests "tests" "openpgp")
|
||||
(map (lambda (name)
|
||||
(test::scm setup
|
||||
#f
|
||||
(path-join "tests" "openpgp" name)
|
||||
(in-srcdir "tests" "openpgp" name))) tests)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user