From ee715201ae784e840b6136393289e6dbd6f4c540 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Tue, 18 Apr 2017 18:51:06 +0200 Subject: gpgscm: Emit JUnit-style XML reports. * tests/gpgscm/Makefile.am (EXTRA_DIST): Add new file. * tests/gpgscm/lib.scm (string-translate): New function. * tests/gpgscm/main.c (main): Load new file. * tests/gpgscm/tests.scm (dirname): New function. (test-pool): Record execution times, emit XML report. (test): Record execution times, record log file name, emit XML report. (run-tests-parallel): Write XML report. (run-tests-sequential): Likewise. * tests/gpgscm/xml.scm: New file. * tests/gpgme/Makefile.am (CLEANFILES): Add 'report.xml'. * tests/gpgsm/Makefile.am: Likewise. * tests/migrations/Makefile.am: Likewise. * tests/openpgp/Makefile.am: Likewise. Signed-off-by: Justus Winter --- tests/gpgscm/lib.scm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/gpgscm/lib.scm') diff --git a/tests/gpgscm/lib.scm b/tests/gpgscm/lib.scm index cafca8dd4..258f6925b 100644 --- a/tests/gpgscm/lib.scm +++ b/tests/gpgscm/lib.scm @@ -199,6 +199,13 @@ (assert (string-contains? "Hallo" "llo")) (assert (not (string-contains? "Hallo" "olla"))) +;; Translate characters. +(define (string-translate s from to) + (list->string (map (lambda (c) + (let ((i (string-index from c))) + (if i (string-ref to i) c))) (string->list s)))) +(assert (equal? (string-translate "foo/bar" "/" ".") "foo.bar")) + ;; Read a word from port P. (define (read-word . p) (list->string -- cgit v1.2.3