]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't skip epg-tests even with gpg 2.0 (Bug#23561)
authorNoam Postavsky <npostavs@gmail.com>
Thu, 12 Jul 2018 00:01:11 +0000 (20:01 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Fri, 13 Jul 2018 01:45:30 +0000 (21:45 -0400)
* test/lisp/epg-tests.el (epg-tests--config-program-alist): New
constant, which allows gpg2 version 2.0+.
(epg-tests-find-usable-gpg-configuration): Pass it to
epg-find-configuration.

test/lisp/epg-tests.el

index 0fe15017dd086d146121b41037804fa3f1fdba25..7efe04bfc007e66b477d78a826e5ac16b1f6bcc3 100644 (file)
   (expand-file-name "data/epg" (getenv "EMACS_TEST_DIRECTORY"))
   "Directory containing epg test data.")
 
+(defconst epg-tests--config-program-alist
+  ;; The default `epg-config--program-alist' requires gpg2 2.1 or
+  ;; greater due to some practical problems with pinentry.  But the
+  ;; tests here all work fine with 2.0 as well.
+  (let ((prog-alist (copy-sequence epg-config--program-alist)))
+    (setf (alist-get "gpg2"
+                     (alist-get 'OpenPGP prog-alist)
+                     nil nil #'equal)
+          "2.0")
+    prog-alist))
+
 (defun epg-tests-find-usable-gpg-configuration (&optional _require-passphrase)
-  (epg-find-configuration 'OpenPGP 'no-cache))
+  (epg-find-configuration 'OpenPGP 'no-cache epg-tests--config-program-alist))
 
 (defun epg-tests-passphrase-callback (_c _k _d)
   ;; Need to create a copy here, since the string will be wiped out