diff options
| -rwxr-xr-x | test/lisp/epg-resources/dummy-pinentry (renamed from test/data/epg/dummy-pinentry) | 0 | ||||
| -rw-r--r-- | test/lisp/epg-resources/pubkey.asc (renamed from test/data/epg/pubkey.asc) | 0 | ||||
| -rw-r--r-- | test/lisp/epg-resources/seckey.asc (renamed from test/data/epg/seckey.asc) | 0 | ||||
| -rw-r--r-- | test/lisp/epg-tests.el | 12 |
4 files changed, 4 insertions, 8 deletions
diff --git a/test/data/epg/dummy-pinentry b/test/lisp/epg-resources/dummy-pinentry index 2228dfb0c6d..2228dfb0c6d 100755 --- a/test/data/epg/dummy-pinentry +++ b/test/lisp/epg-resources/dummy-pinentry | |||
diff --git a/test/data/epg/pubkey.asc b/test/lisp/epg-resources/pubkey.asc index c0bf28f6200..c0bf28f6200 100644 --- a/test/data/epg/pubkey.asc +++ b/test/lisp/epg-resources/pubkey.asc | |||
diff --git a/test/data/epg/seckey.asc b/test/lisp/epg-resources/seckey.asc index 4ac7ba4a502..4ac7ba4a502 100644 --- a/test/data/epg/seckey.asc +++ b/test/lisp/epg-resources/seckey.asc | |||
diff --git a/test/lisp/epg-tests.el b/test/lisp/epg-tests.el index 2a9c021c67b..c9c92f529be 100644 --- a/test/lisp/epg-tests.el +++ b/test/lisp/epg-tests.el | |||
| @@ -22,14 +22,11 @@ | |||
| 22 | ;;; Code: | 22 | ;;; Code: |
| 23 | 23 | ||
| 24 | (require 'ert) | 24 | (require 'ert) |
| 25 | (require 'ert-x) | ||
| 25 | (require 'epg) | 26 | (require 'epg) |
| 26 | 27 | ||
| 27 | (defvar epg-tests-context nil) | 28 | (defvar epg-tests-context nil) |
| 28 | 29 | ||
| 29 | (defvar epg-tests-data-directory | ||
| 30 | (expand-file-name "data/epg" (getenv "EMACS_TEST_DIRECTORY")) | ||
| 31 | "Directory containing epg test data.") | ||
| 32 | |||
| 33 | (defconst epg-tests--config-program-alist | 30 | (defconst epg-tests--config-program-alist |
| 34 | ;; The default `epg-config--program-alist' requires gpg2 2.1 or | 31 | ;; The default `epg-config--program-alist' requires gpg2 2.1 or |
| 35 | ;; greater due to some practical problems with pinentry. But most | 32 | ;; greater due to some practical problems with pinentry. But most |
| @@ -85,8 +82,7 @@ | |||
| 85 | '(with-temp-file (expand-file-name | 82 | '(with-temp-file (expand-file-name |
| 86 | "gpg-agent.conf" epg-tests-home-directory) | 83 | "gpg-agent.conf" epg-tests-home-directory) |
| 87 | (insert "pinentry-program " | 84 | (insert "pinentry-program " |
| 88 | (expand-file-name "dummy-pinentry" | 85 | (ert-resource-file "dummy-pinentry") |
| 89 | epg-tests-data-directory) | ||
| 90 | "\n") | 86 | "\n") |
| 91 | (epg-context-set-passphrase-callback | 87 | (epg-context-set-passphrase-callback |
| 92 | context | 88 | context |
| @@ -94,11 +90,11 @@ | |||
| 94 | ,(if require-public-key | 90 | ,(if require-public-key |
| 95 | '(epg-import-keys-from-file | 91 | '(epg-import-keys-from-file |
| 96 | context | 92 | context |
| 97 | (expand-file-name "pubkey.asc" epg-tests-data-directory))) | 93 | (ert-resource-file "pubkey.asc"))) |
| 98 | ,(if require-secret-key | 94 | ,(if require-secret-key |
| 99 | '(epg-import-keys-from-file | 95 | '(epg-import-keys-from-file |
| 100 | context | 96 | context |
| 101 | (expand-file-name "seckey.asc" epg-tests-data-directory))) | 97 | (ert-resource-file "seckey.asc"))) |
| 102 | (with-temp-buffer | 98 | (with-temp-buffer |
| 103 | (make-local-variable 'epg-tests-context) | 99 | (make-local-variable 'epg-tests-context) |
| 104 | (setq epg-tests-context context) | 100 | (setq epg-tests-context context) |