tests: Run the OpenPGP tests using the new extended key format.
authorJustus Winter <justus@g10code.com>
Mon, 19 Jun 2017 08:17:57 +0000 (10:17 +0200)
committerJustus Winter <justus@g10code.com>
Mon, 19 Jun 2017 14:51:26 +0000 (16:51 +0200)
* tests/openpgp/all-tests.scm: Generalize a bit, and also add a
variant that uses the new extended key format.
* tests/openpgp/defs.scm (create-gpghome): Conditionally enable the
new extended key format.

Signed-off-by: Justus Winter <justus@g10code.com>
tests/openpgp/all-tests.scm
tests/openpgp/defs.scm

index 6584df2..4dd6d6f 100644 (file)
      (path-join "tests" "openpgp" "setup.scm")
      (in-srcdir "tests" "openpgp" "setup.scm"))))
 
- (define setup-use-keyring
+ (define (qualify path variant)
+   (string-append "<" variant ">" path))
+
+ (define (setup* variant)
    (make-environment-cache
     (test::scm
      #f
-     (string-append "<use-keyring>" (path-join "tests" "openpgp" "setup.scm"))
+     (qualify (path-join "tests" "openpgp" "setup.scm") variant)
      (in-srcdir "tests" "openpgp" "setup.scm")
-     "--use-keyring")))
+     (string-append "--" variant))))
+
+ (define setup-use-keyring (setup* "use-keyring"))
+ (define setup-extended-key-format (setup* "extended-key-format"))
 
  (define all-tests
    (parse-makefile-expand (in-srcdir "tests" "openpgp" "Makefile.am")
                    (in-srcdir "tests" "openpgp" name))) all-tests)
   (map (lambda (name)
         (test::scm setup-use-keyring
-                   (string-append "<use-keyring>"
-                                  (path-join "tests" "openpgp" name))
+                   (qualify (path-join "tests" "openpgp" name) "use-keyring")
+                   (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")
                    (in-srcdir "tests" "openpgp" name)
-                   "--use-keyring")) all-tests)))
+                   "--extended-key-format")) all-tests)))
index a61e6c3..50976b9 100644 (file)
               "allow-preset-passphrase"
               "no-grab"
               "enable-ssh-support"
+              (if (flag "--extended-key-format" *args*)
+                  "enable-extended-key-format" "#enable-extended-key-format")
               (string-append "pinentry-program " (tool 'pinentry))
               (string-append "scdaemon-program " (tool 'scdaemon))
               ))