From 8461cfc8fcef424c7f1098f967679b4bdaa4348e Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 24 Oct 2020 02:36:33 +0200 Subject: [PATCH] Move epg.el test data to follow our conventions * test/lisp/epg-tests.el (ert-x): Require. (epg-tests-data-directory): Remove variable. (with-epg-tests): Use ert-resource-file. * test/lisp/epg-resources/*: Moved from test/data/epg/. --- test/{data/epg => lisp/epg-resources}/dummy-pinentry | 0 test/{data/epg => lisp/epg-resources}/pubkey.asc | 0 test/{data/epg => lisp/epg-resources}/seckey.asc | 0 test/lisp/epg-tests.el | 12 ++++-------- 4 files changed, 4 insertions(+), 8 deletions(-) rename test/{data/epg => lisp/epg-resources}/dummy-pinentry (100%) rename test/{data/epg => lisp/epg-resources}/pubkey.asc (100%) rename test/{data/epg => lisp/epg-resources}/seckey.asc (100%) diff --git a/test/data/epg/dummy-pinentry b/test/lisp/epg-resources/dummy-pinentry similarity index 100% rename from test/data/epg/dummy-pinentry rename to test/lisp/epg-resources/dummy-pinentry diff --git a/test/data/epg/pubkey.asc b/test/lisp/epg-resources/pubkey.asc similarity index 100% rename from test/data/epg/pubkey.asc rename to test/lisp/epg-resources/pubkey.asc diff --git a/test/data/epg/seckey.asc b/test/lisp/epg-resources/seckey.asc similarity index 100% rename from test/data/epg/seckey.asc rename to 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 @@ ;;; Code: (require 'ert) +(require 'ert-x) (require 'epg) (defvar epg-tests-context nil) -(defvar epg-tests-data-directory - (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 most @@ -85,8 +82,7 @@ '(with-temp-file (expand-file-name "gpg-agent.conf" epg-tests-home-directory) (insert "pinentry-program " - (expand-file-name "dummy-pinentry" - epg-tests-data-directory) + (ert-resource-file "dummy-pinentry") "\n") (epg-context-set-passphrase-callback context @@ -94,11 +90,11 @@ ,(if require-public-key '(epg-import-keys-from-file context - (expand-file-name "pubkey.asc" epg-tests-data-directory))) + (ert-resource-file "pubkey.asc"))) ,(if require-secret-key '(epg-import-keys-from-file context - (expand-file-name "seckey.asc" epg-tests-data-directory))) + (ert-resource-file "seckey.asc"))) (with-temp-buffer (make-local-variable 'epg-tests-context) (setq epg-tests-context context) -- 2.39.2